Hi,
How to get the Last inserted Id value form database using entity framework webAPI .
that has id as primary key and is a identity
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Brijesh RathorPosted Dec 8, 2016, 8:08 AM
Hope this will help you.Harshal PatilPosted Dec 8, 2016, 7:24 AM
int lastid = entity.tblLocations.Max(p => p.id);var datainsert = new Customer() { Name = "Steven" };context.AddObject(customer);context.SaveChanges();var id = customer.Id;SanthoshPosted Dec 8, 2016, 5:21 AM
SanthoshPosted Dec 1, 2016, 2:03 AM
kamalPosted Dec 1, 2016, 1:44 AM