LINQ means Language Integrated Query. It was introduced in .NET Framework 3.5 to query the data from different data sources such as collections, generics, XML documents, SQL databases, etc., in both C# and VB.NET based on our requirements.
Generally, the LINQ will add a rich, standardized query syntax in .NET programming languages. It will allow the developers to write SQL style queries within the code to interact with any type of data.
In LINQ, we can write the queries in two ways.
In LINQ, to write the queries using query syntax, the structure should be as shown below.
We need to follow this structure while writing the queries in LINQ. To learn more about Query syntax, refer to LINQ Query Syntax.
In LINQ, the method syntaxes will use extension methods of Enumerable or Queryable static classes.
Following is the example of using LINQ method syntaxes in c#.
To learn more about method syntaxes in LINQ, refer LINQ Method Syntax.
To learn more about LINQ in C#, refer step by step LINQ Tutorial.