作者: 转载 更新时间:6/13/17 10:14:03 PM 1072 人浏览
在EntityFramework中,有些字段是自递增的,但可能并不一定是主键,而在调用EntityFramework的SaveChange的时候,我们希望添加的时候能自动自递增,那么只需要在实体定义上加[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
EntityFramwork