I have a IList of Client type. I would need to iterate through it and return an element that matches some condition. I wanted to use "smarter" way than foreach so I tried Single method, however I am not sure why this works and if it can be done different way (I am not that advanced):
private client GetClientByID(short ID)
{
return this.ListOfClient.Single(c => c.ID == ID);
}
I do not understand the use of lambda expression..I tried an anonymous method but was not able to write it properly.. thanks