title: How to get EFCore In-memory db to auto-increment non-key fields
body: <p>We have an entity keyed on a guid with another human-readable key based on an auto-incrementing int property. This works as expected when running the app.</p>
  
  <p>For testing purposes we are using an EF in-memory database but this only seems to auto-increment a column if it also also a key.</p>
  
  <p>Using either the property annotation attribute or the fluent API has no effect.</p>
  
  <pre><code>    [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
      public int OrderNumber { get; private set; }
  
      ===========
  
      modelBuilder.Entity&lt;Order&gt;(order =&gt;
      {
          order.Property(p =&gt; p.OrderNumber).ValueGeneratedOnAdd();
      });
  </code></pre>
  
  <p>In both cases OrderNumber is left as 0 after insert.  Is there any way of getting the in-memory db to do this, or is this a known limitation?  (Googling has uncovered issues around re-seeding of key values, but not this particular issue)</p>