Chapter 7. LINQ to Entities: Basic Concepts and Features
In the previous chapter, we learned new features of C# 3.0 including LINQ. In this chapter and the next, we will explain how to use LINQ to query a database, or in other words, how to use LINQ to Entities in C#. After reading these two chapters we will have a good understanding of LINQ to Entities so that we can rewrite the data access layer of our WCF service with LINQ to Entities, to securely and reliably communicate with the underlying database.
In this chapter, we will cover the basic concepts and features of LINQ to Entities, which include:
What ORM is
What LINQ to Entities is
What LINQ to SQL is
Comparing LINQ to Entities with LINQ to Objects and LINQ to SQL
Modeling the
Northwind
database with LINQ to EntitiesQuerying and updating a database with a table
Deferred execution
Lazy loading and eager loading
Joining two tables
Querying with a view
In the next chapter, we will cover the advanced concepts and features of LINQ to Entities such...