-
Book Overview & Buying
-
Table Of Contents
C# 14 and .NET 10 – Modern Cross-Platform Development Fundamentals - Tenth Edition
By :
Now that we have a model that maps to the Northwind database and two of its tables, we can write some simple Language-Integrated Query (LINQ) queries to fetch data. You will learn much more about writing LINQ queries in Chapter 11, Querying and Manipulating Data Using LINQ.
LINQ to Entities (a.k.a. LINQ to EF Core) is a LINQ provider that converts a LINQ query into SQL to execute against the database. You can write a LINQ query built up over many C# statements.
This is known as deferred execution. Only when the query is enumerated using foreach, or when you call a method such as ToArray or ToList on the LINQ query, will you trigger the execution of the query against the database, and the results are returned to your code. This is known as materialization.
For now, just write the code and view the results:
WorkingWithEFCore project, add a new class file named Program.Helpers.cs.Program.Helpers.cs, delete any existing code...