If you want max Id from your table using LINQ then you can use bellow code.
Enjoy!!
int maxIdProd = context.Product.OrderBy(o => o.Id).Last(); // OR var max = context.Product.Select(x=>x.ProductID).Max();
Enjoy!!
No comments:
Post a Comment