I have this:
var result = (from t in MyDC
where t.UserID == 6
orderby t.UpdateTime
select t.ID).Last();
Basically, I’m using Linq-to-Sql and it doesn’t support the .Last operator. I could retrieve all the records of the user and then using linq to objects to get my value but I’m wondering how to do this with linq-to-sql and return only one record.
Thanks for your suggestions.
Just order by descending and use
.First()instead: