D S

D S

  • NA
  • 5
  • 13.5k

Return only firstorderfault from var

Jul 15 2014 12:34 AM

Hello,

see topic

How do I make a var return only firstordefault?

var GetLastCat = from c in db.table<CatTable> orderby c.ID asc select c;

foreach (CatTable cat in GetLastCat)

{

CatList.ID = cat.ID;

}

I don't know how to return only the first hit, since using ascending in my from would give me the latest entry this is what I want.


Answers (2)