ado.net实体框架为oracle 12c标识列

时间:2016-08-30 07:05:21

标签: c# oracle entity-framework

有没有办法告诉实体框架列是identity col并自动设置storegeneratedpattern = identity。手动完成它有点问题

public partial class EDUCATIONGROUPS 
{ 
    public EDUCATIONGROUPS() { this.EDUCATIONGROUP_EDUCATION = new HashSet<EDUCATIONGROUP_EDUCATION>(); } 
    public int EDUCATIONGROUP_ID { get; set; } 
    public string NAME { get; set; } 
    public System.DateTime MODIFIEDTIME { get; set; } 
    public string MODIFIEDBY { get; set; } 
    public virtual ICollection<EDUCATIONGROUP_EDUCATION> EDUCATIONGROUP_EDUCATION { get; set; } 
}

首先创建数据库。

1 个答案:

答案 0 :(得分:0)

转到模型浏览器中选择您的实体,然后选择您要使其成为身份的属性,请参阅此列的属性并将StoreGenerationPattern更改为Identity。