In the previous chapter, you wrote a few simple LINQ queries, but I didn't properly explained how LINQ works.
LINQ has several parts; some are required and some are optional:
Extension methods (required): These are
Where
,OrderBy
,Select
, and so on. These provide the functionality of LINQ.LINQ providers (required): LINQ to Objects, LINQ to Entities, LINQ to XML, LINQ to OData, LINQ to Amazon, and so on, are LINQ providers. These convert standard LINQ operations into specific commands for different types of data.
Lambda expressions (optional): These can be used instead of named methods to simplify LINQ extension method calls.
LINQ query comprehension syntax (optional): These include
from
,in
,where
,orderby
,descending
,select
, and so on. These are C# keywords that are aliases for some of the LINQ extension methods, and their use can simplify the queries you write, especially if you already have experience with other query languages such as Structured Query Language ...