2
Answers

Return only firstorderfault from var

Ask a question
D S

D S

10y
672
1

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)