I’ve got a database table with the following schema:
id
screenshot
language
projects_ID
I’m need to write a LINQ query, that, given an ‘id’, ‘projects_ID’, and ‘language’, will return the ‘id’ of the next row that has a matching ‘projects_ID’ and ‘language’.
In English, my query would be:
select the next ‘id’ from screenshots after the current ‘id’ where
‘projects_ID’ == current ‘projects_ID’ and language == current ‘language’
Is this possible to do this via LINQ?
Thanks.
Sounds like you probably want:
Or as a query expression:
The result will be
nullif there are no matches (e.g. if you’re already looking at the last ID). This is assuming by “next” you mean “matching item with the lowest ID greater than the current one”.