I am trying to get a row (object) based on max RollNumber , which is a long Datatype field . I expect it to return a null object if it is not there, so I used SingleorDefault . But it looks like my request is wrong (linq work is done here). here is the request:
SchoolContextExpress db = new SchoolContextExpress(); Profile profile = db.Profiles.Where(p => p.RollNumber == db.Profiles.Max(r=>r.RollNumber)).SingleOrDefault();
thanks for this.
black sensei
source share