linq - Searching for object in IList or IQueryable -
I need to find a match for one item in the IQueryable list. I have the following list:
< Pre> IQueryable & lt; EventItem & gt; EventItems = New Question Qualified & lt; EventItem & gt; (); Event Event Event Item1 = New Event Item ("Event 1"); Event Event Event Item2 = New Event Item ("Event2"); EventItems.Add (eventItem1); EventItems.Add (eventItem2);
I want to find an event in the list by passing in an EventItem2 event event. How can I search for items and some items such as event item found = event events Select (EventItm2);
Cheers,
s
Linux certifies is. Where a method lets you evaluate the item you are looking for in Lambda expression.
EventItem found = Event item. Where (E => E == EventItm2) .SingleOrDefault ();
can be found, so you need to check that this query / list