Does Entity Framework 4 Code First have support for identity generators like NHibernate?

前端 未结 3 1337
暖寄归人
暖寄归人 2020-11-27 07:57

This question, asked a year ago, is similar: Does the Entity Framework 4 support generators for id values like NHibernate?

But what I\'d like to know is if the code

3条回答
  •  遥遥无期
    2020-11-27 08:10

    No.

    Mine Entity Framework 4.1.10715 installed by NuGet. maybe you could use attribute

    [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
    public int Id {get;set;}
    

    please see (The full list of annotations supported in EF 4.1 : CTRL+F in page) here.

提交回复
热议问题