Bobby J
0
Q:

get last id ef

//Grab the highest value using the Max() method
int max = db.Products.Max(p => p.ID);
0
//Grab the highest ID value using the OrderByDescending() method
var max = db.Products.OrderByDescending(p => p.ID).FirstOrDefault().ID;
0

New to Communities?

Join the community