I have a problem with LINQ query. Could somebody please help?
There is one table Content with Columns Id (unique), ContentId, Version.
I’d like to get the latest version for each unique Content Id.
So if table is:
- Id, ContentId, Version
- 1, 1, 1
- 2, 1, 2
- 3, 2, 1
Then query should return:
- Id, ContentId, Version
- 2, 1, 2
- 3, 2, 1
Maybe something like this:
Where db is the linq data context