【发布时间】:2017-11-25 07:39:48
【问题描述】:
使用下面的代码,
public class UserProfile
{
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public Guid Id { get; set; }
// more properties here
}
我以为 EF 使用的是 newguid(),但是当我检查数据库时,我看到默认值是 newsequentialid()
这是 EF 的默认行为吗?还是因为我使用的是 SQL Server 2017?
【问题讨论】:
标签: c# entity-framework entity-framework-6 ef-code-first