0
我在EF中有一張表,其中Id
列是PK和Auto_Increment
。我用這個代碼中插入一行到表:是否可以實現通過EF添加插入行的ID
Cut newCut = new Cut()
{
Name = name,
Comments = comments
};
context.Cuts.AddObject(newCut);
context.SaveChanges();
可以實現添加的行的Id
沒有其他查詢?
請原諒我這個初學者問題。 – 2013-04-04 10:31:17