title: 'CompanyName.Foo' is a 'namespace' but is used like a 'type'
body: <p><strong>Restatement of the question</strong></p>
  
  <p>I'm resurrecting this question because I just ran into this error again today, and I'm still utterly confused why the C# compiler bothers to check for collisions between namespaces and types in contexts where it makes no sense for a namespace to exist.</p>
  
  <p>If I have...</p>
  
  <pre><code>public Foo MyFoo { get; set; }
  </code></pre>
  
  <p>...why would the compiler care that <code>Foo</code> is both a namespace and a type? Can you declare a property as a namespace instead of a type?</p>
  
  <p>What is the logic behind the "namespace used like type" compiler error? What problem is this saving me from?</p>
  
  <p>[And how do I tag Eric Lippert? :)]</p>
  
  <hr>
  
  <p><strong>Original Question</strong></p>
  
  <hr>
  
  <p><strong>The problem</strong></p>
  
  <p>I have a project "Foo" with default namespace <code>CompanyName.Foo</code>. I have a database that's also called "Foo".</p>
  
  <p>And when I run SqlMetal.exe on the database, it generates a class <code>CompanyName.Foo.Models.Foo</code>.</p>
  
  <p>Then, when I attempt to create a property with this class as the type, like this...</p>
  
  <pre><code>using CompanyName.Foo.Models;
  ...
  public Foo DataContext { get; set; }
  </code></pre>
  
  <p>...I get the error: </p>
  
  <blockquote>
    <p>'CompanyName.Foo' is a 'namespace' but is used like a 'type'.</p>
  </blockquote>
  
  <p>I am forced to do...</p>
  
  <pre><code>public CompanyName.Foo.Models.Foo Foo { get; set; } // :-(
  </code></pre>
  
  <p><strong>Questions:</strong></p>
  
  <ol>
  <li><p>Why does this error occur? My property declaration doesn't contain <code>CompanyName</code>, so why is this a problem? Simply put: <code>Foo != CompanyName.Foo</code>. Also, just to be sure, I did a search of my entire solution for <code>namespace Foo</code> and came up with zero hits (if I had actually used a namespace <code>Foo</code>, I could understand getting an error).</p></li>
  <li><p><em>[answered]</em> Is there any way around fully qualifying <code>Foo</code> every time I want to use it?</p></li>
  <li><p><em>[answered]</em> Is there any way to get SqlMetal to name the class anything other than <code>Foo</code> (w/o changing the name of my database)? I can change the namespace using a switch, but I don't know of a way to change the actual class name.</p></li>
  </ol>
  
  <p><strong>Update</strong></p>
  
  <p>Still seeking an answer to (1).</p>
  
  <p>O.K.W. nailed (2) &amp; (3).</p>
  
  <p><strong>Usings</strong></p>
  
  <p>A request was made for all my <code>using</code> statements:</p>
  
  <pre><code>using System;
  using System.ComponentModel;
  using System.Data.Linq;
  using System.Linq;
  using MyCompany.Foo.Models;
  </code></pre>