Entity Framework 4.1: Expert’s Cookbook

More than 40 recipes for successfully mixing Test Driven Development, architecture, and Entity Framework Code First with this book and ebook

Entity Framework 4.1: Expert’s Cookbook

Cookbook
Devlin Liles , Tim Rayburn

More than 40 recipes for successfully mixing Test Driven Development, architecture, and Entity Framework Code First with this book and ebook
$10.00
$59.99
RRP $35.99
RRP $59.99
eBook
Print + eBook
$12.99 p/month

Get Access

Get Unlimited Access to every Packt eBook and Video course

Enjoy full and instant access to over 3000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

+ Collection
Free Sample

Book Details

ISBN 139781849684460
Paperback352 pages

About This Book

  • 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

Who This Book Is For

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.

Table of Contents

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

What You Will Learn

  • 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

In Detail

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.

Authors

Table of Contents

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

Book Details

ISBN 139781849684460
Paperback352 pages
Read More