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