so I was wondering if someone would make a very thorough explanation of what exactly I have done here, I know what im working with, and what the meaning of the code is, however, if I were to explain it, I would be clueless.
public static IEnumerable<TSource> VisitorWhere<TSource>(this IEnumerable<TSource> enumerable, Predicate<TSource> CompareMethod)
{
ICollection<TSource> temp = new List<TSource>();
foreach (TSource item in enumerable)
{
if(CompareMethod(item))
{
temp.Add(item);
}
}
return temp;
}