title: Ignoring a conflicting definition from global namespace in a single C# file
body: <p>I have a generated code file that creates a class and doesn't give it a namespace. Because the code is generated and updated some times I don't want to add any additional code there.</p>
  
  <pre><code>using System;
  
  public class Apartment { ... }
  </code></pre>
  
  <p>I also have the Apartment class in a namespace (in different dll).</p>
  
  <pre><code>using System;
  namespace My.Core.Entities {
    public class Apartment  { ... }
  }
  </code></pre>
  
  <p>Now, I try to use the former one in a unit test (that references to both dlls). I have tried following code to ignore the global class.</p>
  
  <pre><code>using System;
  using Apartment = Core.Entities.Apartment;
  using GlobApartment = global::Apartment
  
  public class Tests {
    private List&lt;Apartment&gt; _apartments = new List&lt;Apartment&gt;();
  }
  </code></pre>
  
  <p>It gives the error <code>Namespace '&lt;global namespace&gt;' contains a definition conflicting with alias 'Apartment'</code></p>
  
  <p>I understand why the error happens. The question is if there is any way to ignore the global::Apartment some way in this file (I tried the <code>using GlobApartment</code> thing)? I wouldn't like to change all Apartment to My.Core.Entities.Apartment. Is there any way to use the single term <code>Apartment</code> in the code? </p>