title: Entity Framework 6, enums
body: <p>I have an entity "Payment" in my edmx (Model-First). This entity contains int32 property "Method".</p>
  
  <p>I created enum type in common assembly:</p>
  
  <pre><code>public enum PaymentMethod
  {
      check = 100,
      credit_card = 200
  }
  </code></pre>
  
  <p>In edmx designer I clicked right button on property Method and selected "Convert to enum".
  I dialog I entered Enum Type Name = "PaymentMethod"   also entered External Type Name = "MyApp.Common.PaymentMethod".</p>
  
  <p>Now, when I try to something like:</p>
  
  <pre><code>if(payment.Method == MyApp.Common.PaymentMethod.check)
  </code></pre>
  
  <p>it says 
  <strong>Cannot implicitly convert type 'MyApp.Common.PaymentMethod' to 'Data.PaymentMethod'. An explicit conversion exists (are you missing a cast?)</strong></p>
  
  <p>Why EF still want to use internal enum type?
  edmx contans correct xml:</p>
  
  <pre><code> &lt;EnumType Name="PaymentMethod"
   a:ExternalTypeName="MyApp.Common.PaymentMethod"&gt; xmlns:a="http://schemas.microsoft.com/ado/2006/04/codegeneration" /&gt;
  </code></pre>