private static T FindInCollection<T>(ICollection<T> collection, Predicate<T> match)
{
foreach (T item in collection)
{
//So how do I reference match to return the matching item?
}
return default(T);
}
ICollection<MyTestClass> receivedList = //Some list I've received from somewhere else
MyTestClass UsefulItem = FindInCollection<MyTestClass>(receivedList, i => i.SomeField = "TheMatchingData");