主キーIDがID列であるテーブルがあります。新しいレコードが作成されると、idが1ずつ増えると思います。
ただし、デバッグ中に0であることがわかりました。なんで?
必要なコード:
public DbSet<testDetails> testDetailRecords { get; set; }
testDetails test = testContext.testDetailRecords.Create();
// test.id is 0 when hover over it
public class testDetails : IEntityWithRelationships
{
[Key]
[Required]
[Display(Name = "Primary Key", Description = "Primary Key")]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long id { get; set; }