LINQ or Language-Integrated Query is a framework or technology based on integrated query capacity into .Net Core (or .Net Framework) languages like C#. It was released with version 3.0 of C# and been ever since an integral part of C# development.

LINQ is arguable one of the most powerful features of C# which has increased developer productivity by multiple folds.

In this video, I will first walk through creating an application to use the Where statement of LINQ to filter out all even numbers from a number array. And then I will subsequently implement the same function from scratch, to achieve the same outcome.

This will demonstrate what is the internal implementation of Where and how it all works together with other features of .Net.

The three main constituents or feature of the C# programming language that is necessary for the implementation of a Where query is as follows:

  1. First, the Extension Method
  2. Second, Delegate (in the case of Where it is Func)
  3. And last but not the least “yield return” statement

The “yield return” statement is the one that makes LINQ queries to execute lazily. Meaning a LINQ query is executed only when we loop through the IEnumerable.

This is the first video of a series I want to cover on the internals of some of the .Net Core/C# language features.

#linq #programming #developer

LINQ Internals (Deep dive into Where)
2.25 GEEK