<p>Is there a way to take a class name and convert it to a string in C#? </p>

<p>As part of the Entity Framework, the .Include method takes in a dot-delimited list of strings to join on when performing a query. I have the class model of what I want to join, and for reasons of refactoring and future code maintenance, I want to be able to have compile-time safety when referencing this class.</p>

<p>Thus, is there a way that I could do this:</p>

<pre><code>class Foo
{
}

tblBar.Include ( Foo.GetType().ToString() );
</code></pre>

<p>I don't think I can do GetType() without an instance. Any ideas?</p>

You can't use
```
.GetType()
```
without an instance because
```
GetType
```
is a method.
You can get the name from the type though like this:
```
```
typeof(Foo).Name
```
```
And as pointed out by Chris, if you need the assembly qualified name you can use
```
```
typeof(Foo).AssemblyQualifiedName
```
```