Is there a convenient way to get IDENTITY key ID which I insert just now?
Closed this issue · 4 comments
TuYingfang commented
Is there a convenient way to get IDENTITY key ID which I insert just now?
TuYingfang commented
Lifeng-Liang commented
var user = new User{Name = "tom", Age = 18); // now user.Id == 0
user.Save(); // now user.Id == the key id you just insert.
TuYingfang commented
var user = new User{Name = "tom", Age = 18); // now user.Id == 0
DbEntry.Insert(user );now user.Id == the key id I just insert?
Lifeng-Liang commented
this feature only works for the model inherits from DbObjectModel.