Answers for "get last id ef"

C#
0

get last id ef

//Grab the highest value using the Max() method
int max = db.Products.Max(p => p.ID);
Posted by: Guest on December-01-2020
0

get last id ef

//Grab the highest ID value using the OrderByDescending() method
var max = db.Products.OrderByDescending(p => p.ID).FirstOrDefault().ID;
Posted by: Guest on December-01-2020

C# Answers by Framework

Browse Popular Code Answers by Language