c# - how do i return a count of match items -


i have sorted generic list. return first 10 match condition.

sort of method below first 10 items

  mysortedlist.findall(delegate(myclass tmp){ return tmp.id == 123;}); 

something following:

int count = 0; mysortedlist.findall(delegate(myclass tmp){ return (tmp.id == 123 && ++count <= 10);}); 

Comments

Popular posts from this blog

Cursor error with postgresql, pgpool and php -

delphi - ESC/P programming! -

c++ - error: use of deleted function -