title: Entity Framework Composite primary key when one of them is an identity
body: <p>I have a composite key mapped in a class as shown:</p>
  
  <pre><code>HasKey(l =&gt; new { l.A, l.B });
  </code></pre>
  
  <p>But, here A is supposed to be an identity.</p>
  
  <pre><code>Property(l =&gt; l.A).HasColumnName("A").HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
  Property(l =&gt; l.B).HasColumnName("B");
  </code></pre>
  
  <p>However, when I try to Add an object with the value of A(null since it is an identity) and B, I get a Primary Key violation.</p>
  
  <p>Is there any way to get around this?</p>
  
  <p>The types are as follows:</p>
  
  <pre><code>public Int64? A{ get; set; } //Identity
  public int B { get; set; }
  </code></pre>
  
  <p>And from a DB world:</p>
  
  <pre><code>A   bigint
  B   int
  </code></pre>