So i have this function
that return element from collection
based on condition
public static T Search<T>(IEnumerable<T> source, Func<T, bool> filter)
{
return source.FirstOrDefault(filter);
}
And i want to convert this to return all the elements
form my collection
that mach my condition
.
so instead of change the function signature to public static IEnumerable<T> Search<T>(IEnumerable<T> source, Func<T, bool> filter)
What i need to changed inside my function ?