linq to sql - how to get next highest id in query
Posted on 2010-09-02
In linq say my query returns the first and last foo object
FOO first = dataContext.Foos.First();
FOO last = dataContext.FOOs.Last();
Great! The FOO table has an autoincrement number which works great.
Now I want to be able to get the next FOO object with the next highest ID, so my query would be something like
FOO nextFoo = dataContext.FOOs //get the next foo object
So my question is how to get the next FOO object with the next highest ID?