score:3

Accepted answer

sounds like you probably want:

var next = table.where(item => item.id > lastid &&
                               item.projects_id == projects_id &&
                               item.language == language)
                .orderby(item => item.id)
                .firstordefault();

or as a query expression:

var next = (from item in table
            where item.id > lastid &&
                  item.projects_id == projects_id &&
                  item.language == language
            orderby item.id
            select item).firstordefault();

the result will be null if 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".


Related Query

More Query from same tag