Now that we have a fair understanding of LINQ queries, let's consider a scenario in which we need to alter the way LINQ works. For the sake of explanation, let's consider a scenario in which we need to change the built-in implementation of the Where clause in the query.
To do that, we first need to understand how the Where clause works in LINQ queries. We can do this by looking at the definition of the Where clause in Visual Studio. The following is how the definition of the Where clause would appear:
public static IEnumerable<TSource> Where(
this IEnumerable<TSource> source,
Func<TSource, bool> predicate)
Now, to create our own implementation of the Where clause, we will need to create an extension method with the same signature.
Once this is done, we can remove the using statement for System.Linq in the respective...