📅  最后修改于: 2022-03-11 14:48:38.953000             🧑  作者: Mango
//Grab the highest ID value using the OrderByDescending() method
var max = db.Products.OrderByDescending(p => p.ID).FirstOrDefault().ID;