我有这个班级和表格:
public class Foo
{
public Guid Id {get;set;}
public string Name {get;set;}
}
Run Code Online (Sandbox Code Playgroud)
create table Foo
(
id uniqueidentifier primary KEY DEFAULT (newsequentialid()),
name nvarchar(255)
)
Run Code Online (Sandbox Code Playgroud)
问题是,当我尝试保存新的foo时,第一个使用了0000-000-00 ... id和第二个也是,所以我得到了约束异常
有谁知道修复?
code-first entity-framework-4 ef4-code-only entity-framework-ctp5