Entity Framework 4.1: Expert’s Cookbook
Formats:
save 15%!
save 37%!
Free Shipping!
| Also available on: |
|
- Hands-on solutions with reusable code examples
- Strategies for enterprise ready usage
- Examples based on real world experience
- Detailed and advanced examples of query management
- Step-by-step recipes that will guide you to success
Book Details
Language : EnglishPaperback : 352 pages [ 235mm x 191mm ]
Release Date : March 2012
ISBN : 1849684464
ISBN 13 : 9781849684460
Author(s) : Devlin Liles , Tim Rayburn
Topics and Technologies : All Books, Microsoft Development , Cookbooks, Enterprise, Microsoft
Table of Contents
PrefaceChapter 1: Improving Entity Framework in the Real World
Chapter 2: Understanding the Fluent Configuration API
Chapter 3: Handling Validation in Entity Framework
Chapter 4: Working with Transactions and Stored Procedures
Chapter 5: Improving Entity Framework with Query Libraries
Chapter 6: Improving Complex Query Scenarios
Chapter 7: Using Concurrent and Parallel Processing
Chapter 8: Improving Entity Framework with Complex Business Scenarios
Index
- Chapter 1: Improving Entity Framework in the Real World
- Introduction
- Improving Entity Framework by using code first
- Creating mock database connections
- Implementing the repository pattern
- Implementing the unit of work pattern
- Testing queries
- Creating databases from code
- Testing queries for performance
- Performing load testing against a database
- Chapter 2: Understanding the Fluent Configuration API
- Introduction
- Improving property maps
- Creating one-to-one maps
- Creating one-to-many maps
- Creating many-to-many maps
- Mapping one table to many objects
- Mapping many tables to one object
- Handling inheritance based on database values
- Handling complex key maps
- Chapter 3: Handling Validation in Entity Framework
- Introduction
- Validating simple properties
- Validating complex properties
- Validating collection properties
- Creating custom property validation
- Improving MVC UI with entity framework validation
- Chapter 4: Working with Transactions and Stored Procedures
- Introduction
- Using transaction scopes
- Handling multiple context transactions
- Executing stored procedures
- Retrieving entities with stored procedures
- Updating entities with stored procedures
- Chapter 5: Improving Entity Framework with Query Libraries
- Introduction
- Creating reusable queries
- Improving entity and library reuse
- Implementing composed queries
- Increasing performance with code access
- Improving query testing
- Chapter 6: Improving Complex Query Scenarios
- Introduction
- Grouping at runtime without Lambda
- Handling explicit loading
- Improving complex where clauses
- Implementing the specification pattern
- Chapter 7: Using Concurrent and Parallel Processing
- Introduction
- Implementing optimistic concurrency
- Managing parallel contexts
- Handling data retrieval in highly-threaded environments
- Attaching objects with unit of work
- Improving multiple context performance
- Chapter 8: Improving Entity Framework with Complex Business Scenarios
- Introduction
- Handling soft delete
- Implementing refreshing data on save
- Capturing the audit data
- Improving MVC 3 applications
Devlin Liles
Tim Rayburn
Code Downloads
Download the code and support files for this book.
Submit Errata
Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.
Errata
- 3 submitted: last submission 04 Feb 2013Errata type: Code | Page number: Creating many-to-many maps recipe | Errata date: 29 May 12
The code in "How to do it..." section includes code for a many-to-many relationship between Posts and AuthorDetails, but the "How it works..." section describes a many-to-many relationship between Posts and Tags which makes more sense but doesn't match the code.
Errata type: Others | Page number: 55 | Errata date: 01 Jun 12
Add a new C# class named PostMapping to the Mappings folder with the following code: PostMapping should be AuthorDetailMapping as the class name.
Errata type: Others | Page number: 56 | Errata date: 01 Jun 12
namespace DataAccess { public class BlogContext : DbContext (SHOULD BE DbContext, IUnitOfWork). The book is wrong, the code downloaded is right.
Errata type: Others | Page number: Handling multiple context transactions recipe | Errata date: 02 Jun 12
Both tests check for blogs with Title == "Test" instead of Title == "Testing". Even if the transactions wouldn't roll back, the test would still pass this way.
Errata type: Others | Page number: Implementing composed queries recipe | Errata date: 02 Jun 12
In the ShouldReturnRecordsFromTheDatabaseByDescription test method FilterByBlogName is called instead of FilterByDescription.
Sample chapters
You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.
- Manage database queries
- Leverage the full power of LINQ
- Test the data access layer
- Design an extensible data access layer
- Map any object model to a relational database
- Create clean integration tests
- Test queries in memory
- Compose even the most complex query scenarios
- Create and seed test databases from code
- Use stored procedures without losing the power of object oriented development
Entity Framework 4.1 allows us to dive into the world of data access without having to write SQL statements. With the power to shape data access by your object model comes questions and this book holds the answers.
Entity Framework 4.1: Expert’s Cookbook holds many examples to help guide you through tough technical decisions and avoid technical landmines. The book will guide you from just using Entity Framework to enhancing the data access wizard.
This book starts with examples that require some familiarity of object relational mappers, and then moves on to more advanced tasks. You will be guided through complex mapping scenarios, query definition, reusability, integration with other technologies, and architectural management. The approach is step-by-step and test driven so that it is focused as much as possible on solving problems and getting the most out of the time spent working through the book.
Entity Framework 4.1: Expert’s Cookbook is a must have for any .NET developer who uses Entity Framework, and wants better, cleaner, and more maintainable code.
This book takes a step-by-step problem solving approach that leads you through a problem and explains each step in detail to accomplish the goal. This books gives you concrete code examples as well as detailed information on the decisions involved.
This book is for intermediate to advanced .NET developers who have used LINQ to SQL or Entity Framework in some form but want to have more control over the implementation.

