Microsoft’s principal data access technology, ADO.NET Entity Framework, has had
two major releases as part of the .NET Framework. .NET 3.5 brought us the first version
of Entity Framework, which is covered in the first edition of Programming Entity
Framework (O’Reilly). In 2010, Microsoft .NET 4 was released, containing the next
version of Entity Framework, referred to as Entity Framework 4. The completely revised
second edition of Programming Entity Framework (O’Reilly) was dedicated to teaching
readers how to use this version of Entity Framework in Visual Studio 2010.
When .NET 4 was released, the Entity Framework team was already hard at work on
a new addition, called Code First, to provide an alternative way of building the Entity
Data Model that is core to Entity Framework. Rather than using a visual designer, Code
First allows you to create the model from your existing classes. At the same time, the
team devoted resources to making Entity Framework easier to use. They focused on
the most commonly used features and tasks in Entity Framework and built a new API
called the DbContext API.
This book is dedicated to teaching readers how to use the features of the DbContext
API. In addition to the DbContext class, you’ll find the DbSet class for performing set
operations, improved APIs for change tracking and handling concurrency conflicts, and
a Validation API that integrates with validation features already present in .NET.
In this book, you will learn how to query and update data using the new API, whether
you are working with individual objects or graphs of objects and their related data.
You’ll learn how to take advantage of the change tracking features and Validation.
You’ll find myriad samples and delve into taking advantage of advanced features presented
by the API.