How do I get the max ID with Linq to Entity? January 21, 2023 by Tarik Do that like this db.Users.OrderByDescending(u => u.UserId).FirstOrDefault();