You are previewing Entity Framework 4.0 Recipes: A Problem-Solution Approach.
O'Reilly logo
Entity Framework 4.0 Recipes: A Problem-Solution Approach

Book Description

Entity Framework 4.0 Recipes provides an exhaustive collection of ready-to-use code solutions for Microsoft's Entity Framework, Microsoft's vision for the future of data access. Entity Framework is a model-centric data access platform with an ocean of new concepts and patterns for developers to learn. With this book, you will learn the core concepts of Entity Framework through a broad range of clear and concise solutions to everyday data access tasks. Armed with this experience, you will be ready to dive deep into Entity Framework, experiment with new approaches, and develop ways to solve even the most difficult data access challenges. If you are a developer who likes to learn by example, then this is the right book for you.

  • Gives ready-to-use, real-world recipes to help you with everyday tasks

  • Provides guideposts for learning core concepts

  • Maps out key landmarks for experimenting with your own solutions

Table of Contents

  1. Copyright
  2. About the Authors
  3. About the Technical Reviewers
  4. Acknowledgments
  5. Preface
    1. Who This Book Is For
    2. What's in This Book
    3. About the Recipes
    4. Stuff You Need to Get Started
    5. Code Examples
    6. The Database
    7. Apress Website
  6. 1. Getting Started With Entity Framework
    1. 1.1. A Brief Tour of the Entity Framework World
      1. 1.1.1. Models
      2. 1.1.2. Terminology
      3. 1.1.3. Code
      4. 1.1.4. Visual Studio 2010
    2. 1.2. Using Entity Framework
  7. 2. Entity Data Modeling Fundamentals
    1. 2.1. Creating a Simple Model
      1. 2.1.1. Problem
      2. 2.1.2. Solution
      3. 2.1.3. How It Works
    2. 2.2. Creating a Model from an Existing Database
      1. 2.2.1. Problem
      2. 2.2.2. Solution
      3. 2.2.3. How It Works
    3. 2.3. Modeling a Many-to-Many Relationship with No Payload
      1. 2.3.1. Problem
      2. 2.3.2. Solution
      3. 2.3.3. How It Works
    4. 2.4. Modeling a Many-to-Many Relationship with a Payload
      1. 2.4.1. Problem
      2. 2.4.2. Solution
      3. 2.4.3. How It Works
    5. 2.5. Modeling a Self-Referencing Relationship
      1. 2.5.1. Problem
      2. 2.5.2. Solution
      3. 2.5.3. How It Works
    6. 2.6. Splitting an Entity Across Multiple Tables
      1. 2.6.1. Problem
      2. 2.6.2. Solution
      3. 2.6.3. How It Works
    7. 2.7. Splitting a Table Across Multiple Entities
      1. 2.7.1. Problem
      2. 2.7.2. Solution
      3. 2.7.3. How It Works
    8. 2.8. Modeling Table per Type Inheritance
      1. 2.8.1. Problem
      2. 2.8.2. Solution
      3. 2.8.3. How It Works
    9. 2.9. Using Conditions to Filter an ObjectSet
      1. 2.9.1. Problem
      2. 2.9.2. Solution
      3. 2.9.3. How It Works
    10. 2.10. Modeling Table per Hierarchy Inheritance
      1. 2.10.1. Problem
      2. 2.10.2. Solution
      3. 2.10.3. How It Works
    11. 2.11. Modeling Is-a and Has-a Relationships Between Two Entities
      1. 2.11.1. Problem
      2. 2.11.2. Solution
      3. 2.11.3. How It Works
    12. 2.12. Creating, Modifying, and Mapping Complex Types
      1. 2.12.1. Problem
      2. 2.12.2. Solution
      3. 2.12.3. How It Works
  8. 3. Querying an Entity Data Model
    1. 3.1. Executing an SQL Statement
      1. 3.1.1. Problem
      2. 3.1.2. Solution
      3. 3.1.3. How It Works
    2. 3.2. Returning Objects from a SQL Statement
      1. 3.2.1. Problem
      2. 3.2.2. Solution
      3. 3.2.3. How It Works
    3. 3.3. Returning Objects from an Entity SQL Statement
      1. 3.3.1. Problem
      2. 3.3.2. Solution
      3. 3.3.3. How It Works
    4. 3.4. Specifying Fully Qualified Names in Entity SQL
      1. 3.4.1. Problem
      2. 3.4.2. Solution
      3. 3.4.3. How It Works
    5. 3.5. Finding a Master that Has Detail in a Master-Detail Relationship
      1. 3.5.1. Problem
      2. 3.5.2. Solution
      3. 3.5.3. How It Works
    6. 3.6. Setting Default Values in a Query
      1. 3.6.1. Problem
      2. 3.6.2. Solution
      3. 3.6.3. How It Works
    7. 3.7. Returning Multiple Result Sets From a Stored Procedure
      1. 3.7.1. Problem
      2. 3.7.2. Solution
      3. 3.7.3. How It Works
    8. 3.8. Comparing Against a List of Values
      1. 3.8.1. Problem
      2. 3.8.2. Solution
      3. 3.8.3. How It Works
    9. 3.9. Building and Executing a Query Against an ObjectSet<T>
      1. 3.9.1. Problem
      2. 3.9.2. Solution
      3. 3.9.3. How It Works
    10. 3.10. Returning a Primitive Type From a Query
      1. 3.10.1. Problem
      2. 3.10.2. Solution
      3. 3.10.3. How It Works
    11. 3.11. Filtering Related Entities
      1. 3.11.1. Problem
      2. 3.11.2. Solution
      3. 3.11.3. How It Works
    12. 3.12. Applying a Left Outer Join
      1. 3.12.1. Problem
      2. 3.12.2. Solution
      3. 3.12.3. How It Works
    13. 3.13. Ordering by Derived Types
      1. 3.13.1. Problem
      2. 3.13.2. Solution
      3. 3.13.3. How It Works
    14. 3.14. Paging and Filtering
      1. 3.14.1. Problem
      2. 3.14.2. Solution
      3. 3.14.3. How It Works
    15. 3.15. Grouping by Date
      1. 3.15.1. Problem
      2. 3.15.2. Solution
      3. 3.15.3. How It Works
    16. 3.16. Flattening Query Results
      1. 3.16.1. Problem
      2. 3.16.2. Solution
      3. 3.16.3. How It Works
    17. 3.17. Grouping by Multiple Properties
      1. 3.17.1. Problem
      2. 3.17.2. Solution
      3. 3.17.3. How It Works
    18. 3.18. Using Bitwise Operators in a Filter
      1. 3.18.1. Problem
      2. 3.18.2. Solution
      3. 3.18.3. How It Works
    19. 3.19. Joining on Multiple Columns
      1. 3.19.1. Problem
      2. 3.19.2. Solution
      3. 3.19.3. How It Works
  9. 4. Using Entity Framework in ASP.NET
    1. 4.1. Building a Search Query
      1. 4.1.1. Problem
      2. 4.1.2. Solution
      3. 4.1.3. How It Works
    2. 4.2. Building CRUD Operations in an ASP.NET Web Page
      1. 4.2.1. Problem
      2. 4.2.2. Solution
      3. 4.2.3. How It Works
    3. 4.3. Executing Business Logic When Changes Are Saved
      1. 4.3.1. Problem
      2. 4.3.2. Solution
      3. 4.3.3. How It Works
    4. 4.4. Loading Related Entities
      1. 4.4.1. Problem
      2. 4.4.2. Solution
      3. 4.4.3. How It Works
    5. 4.5. Searching with QueryExtender
      1. 4.5.1. Problem
      2. 4.5.2. Solution
      3. 4.5.3. How It Works
    6. 4.6. Retrieving a Derived Type Using an EntityDataSource Control
      1. 4.6.1. Problem
      2. 4.6.2. Solution
      3. 4.6.3. How It Works
    7. 4.7. Filtering with ASP.NET's URL Routing
      1. 4.7.1. Problem
      2. 4.7.2. Solution
      3. 4.7.3. How It Works
    8. 4.8. Building CRUD Operations with an ObjectDataSource Control
      1. 4.8.1. Problem
      2. 4.8.2. Solution
      3. 4.8.3. How It Works
    9. 4.9. Using Entity Framework With MVC
      1. 4.9.1. Problem
      2. 4.9.2. Solution
      3. 4.9.3. How It Works
  10. 5. Loading Entities and Navigation Properties
    1. 5.1. Loading Related Entities
      1. 5.1.1. Problem
      2. 5.1.2. Solution
      3. 5.1.3. How It Works
    2. 5.2. Loading a Complete Object Graph
      1. 5.2.1. Problem
      2. 5.2.2. Solution
      3. 5.2.3. How It Works
    3. 5.3. Loading Navigation Properties on Derived Types
      1. 5.3.1. Problem
      2. 5.3.2. Solution
      3. 5.3.3. How It Works
    4. 5.4. Using Include() with Other LINQ Query Operators
      1. 5.4.1. Problem
      2. 5.4.2. Solution
      3. 5.4.3. How It Works
    5. 5.5. Deferred Loading of Related Entities
      1. 5.5.1. Problem
      2. 5.5.2. Solution
      3. 5.5.3. How It Works
    6. 5.6. Filtering and Ordering Related Entities
      1. 5.6.1. Problem
      2. 5.6.2. Solution
      3. 5.6.3. How It Works
    7. 5.7. Executing Aggregate Operations on Related Entities
      1. 5.7.1. Problem
      2. 5.7.2. Solution
      3. 5.7.3. How It Works
    8. 5.8. Testing Whether an Entity Reference or Entity Collection Is Loaded
      1. 5.8.1. Problem
      2. 5.8.2. Solution
      3. 5.8.3. How It Works
    9. 5.9. Loading Related Entities Explicitly
      1. 5.9.1. Problem
      2. 5.9.2. Solution
      3. 5.9.3. How It Works
    10. 5.10. Filtering an Eagerly Loaded Entity Collection
      1. 5.10.1. Problem
      2. 5.10.2. Solution
      3. 5.10.3. How It Works
    11. 5.11. Using Relationship Span
      1. 5.11.1. Problem
      2. 5.11.2. Solution
      3. 5.11.3. How It Works
    12. 5.12. Modifying Foreign Key Associations
      1. 5.12.1. Problem
      2. 5.12.2. Solution
      3. 5.12.3. How It Works
  11. 6. Beyond the Basics with Modeling and Inheritance
    1. 6.1. Retrieving the Link Table in a Many-to-Many Association
      1. 6.1.1. Problem
      2. 6.1.2. Solution
      3. 6.1.3. How It Works
    2. 6.2. Exposing a Link Table as an Entity
      1. 6.2.1. Problem
      2. 6.2.2. Solution
      3. 6.2.3. How It Works
    3. 6.3. Modeling a Many-to-Many, Self-Referencing Relationship
      1. 6.3.1. Problem
      2. 6.3.2. Solution
      3. 6.3.3. How It Works
    4. 6.4. Modeling a Self-Referencing Relationship Using Table per Hierarchy Inheritance
      1. 6.4.1. Problem
      2. 6.4.2. Solution
      3. 6.4.3. How It Works
    5. 6.5. Modeling a Self-Referencing Relationship and Retrieving a Complete Hierarchy
      1. 6.5.1. Problem
      2. 6.5.2. Solution
      3. 6.5.3. How It Works
    6. 6.6. Mapping Null Conditions in Derived Entities
      1. 6.6.1. Problem
      2. 6.6.2. Solution
      3. 6.6.3. How It Works
    7. 6.7. Modeling Table per Type Inheritance Using a Non-Primary Key Column
      1. 6.7.1. Problem
      2. 6.7.2. Solution
      3. 6.7.3. How It Works
    8. 6.8. Modeling Nested Table per Hierarchy Inheritance
      1. 6.8.1. Problem
      2. 6.8.2. Solution
      3. 6.8.3. How It Works
    9. 6.9. Limiting the Values Assigned to a Foreign Key
      1. 6.9.1. Problem
      2. 6.9.2. Solution
      3. 6.9.3. How It Works
    10. 6.10. Applying Conditions in Table per Type Inheritance
      1. 6.10.1. Problem
      2. 6.10.2. Solution
      3. 6.10.3. How It Works
    11. 6.11. Creating a Filter on Multiple Criteria
      1. 6.11.1. Problem
      2. 6.11.2. Solution
      3. 6.11.3. How It Works
    12. 6.12. Using Complex Conditions with Table per Hierarchy Inheritance
      1. 6.12.1. Problem
      2. 6.12.2. Solution
      3. 6.12.3. How It Works
    13. 6.13. Modeling Table per Concrete Type Inheritance
      1. 6.13.1. Problem
      2. 6.13.2. Solution
      3. 6.13.3. How It Works
    14. 6.14. Applying Conditions on a Base Entity
      1. 6.14.1. Problem
      2. 6.14.2. Solution
      3. 6.14.3. How It Works
    15. 6.15. Creating Independent and Foreign Key Associations
      1. 6.15.1. Problem
      2. 6.15.2. Solution
      3. 6.15.3. How It Works
    16. 6.16. Changing an Independent Association into a Foreign Key Association
      1. 6.16.1. Problem
      2. 6.16.2. Solution
      3. 6.16.3. How It Works
  12. 7. Working with Object Services
    1. 7.1. Dynamically Building a Connection String
      1. 7.1.1. Problem
      2. 7.1.2. Solution
      3. 7.1.3. How It Works
    2. 7.2. Reading a Model from a Database
      1. 7.2.1. Problem
      2. 7.2.2. Solution
      3. 7.2.3. How It Works
    3. 7.3. Deploying a Model
      1. 7.3.1. Problem
      2. 7.3.2. Solution
      3. 7.3.3. How It Works
    4. 7.4. Using the Pluralization Service
      1. 7.4.1. Problem
      2. 7.4.2. Solution
      3. 7.4.3. How It Works
    5. 7.5. Retrieving Entities from the Object State Manager
      1. 7.5.1. Problem
      2. 7.5.2. Solution
      3. 7.5.3. How It Works
    6. 7.6. Generating a Model from the Command Line
      1. 7.6.1. Problem
      2. 7.6.2. Solution
      3. 7.6.3. How It Works
    7. 7.7. Working with Dependent Entities in an Identifying Relationship
      1. 7.7.1. Problem
      2. 7.7.2. Solution
      3. 7.7.3. How It Works
    8. 7.8. Inserting Entities Using an Object Context
      1. 7.8.1. Problem
      2. 7.8.2. Solution
      3. 7.8.3. How It Works
  13. 8. Plain Old CLR Objects
    1. 8.1. Using POCO
      1. 8.1.1. Problem
      2. 8.1.2. Solution
      3. 8.1.3. How It Works
    2. 8.2. Loading Related Entities With POCO
      1. 8.2.1. Problem
      2. 8.2.2. Solution
      3. 8.2.3. How It Works
    3. 8.3. Lazy Loading With POCO
      1. 8.3.1. Problem
      2. 8.3.2. Solution
      3. 8.3.3. How It Works
    4. 8.4. POCO With Complex Type Properties
      1. 8.4.1. Problem
      2. 8.4.2. Solution
      3. 8.4.3. How It Works
    5. 8.5. Notifying Entity Framework About Object Changes
      1. 8.5.1. Problem
      2. 8.5.2. Solution
      3. 8.5.3. How It Works
    6. 8.6. Retrieving the Original (POCO) Object
      1. 8.6.1. Problem
      2. 8.6.2. Solution
      3. 8.6.3. How It Works
    7. 8.7. Manually Synchronizing the Object Graph and the Object State Manager
      1. 8.7.1. Problem
      2. 8.7.2. Solution
      3. 8.7.3. How It Works
    8. 8.8. Testing Domain Objects
      1. 8.8.1. Problem
      2. 8.8.2. Solution
      3. 8.8.3. How It Works
    9. 8.9. Testing a Repository Against a Database
      1. 8.9.1. Problem
      2. 8.9.2. Solution
      3. 8.9.3. How It Works
  14. 9. Using the Entity Framework in N-Tier Applications
    1. 9.1. Deleting an Entity When Disconnected
      1. 9.1.1. Problem
      2. 9.1.2. Solution
      3. 9.1.3. How It Works
    2. 9.2. Managing Concurrency When Disconnected
      1. 9.2.1. Problem
      2. 9.2.2. Solution
      3. 9.2.3. How It Works
    3. 9.3. Finding Out What Has Changed
      1. 9.3.1. Problem
      2. 9.3.2. Solution
      3. 9.3.3. How It Works
    4. 9.4. Using POCO With WCF
      1. 9.4.1. Problem
      2. 9.4.2. Solution
      3. 9.4.3. How It Works
    5. 9.5. Using Self-Tracking Entities With WCF
      1. 9.5.1. Problem
      2. 9.5.2. Solution
      3. 9.5.3. How It Works
    6. 9.6. Validating Self-Tracking Entities
      1. 9.6.1. Problem
      2. 9.6.2. Solution
      3. 9.6.3. How It Works
    7. 9.7. Using Self-Tracking Entities on the Server Side
      1. 9.7.1. Problem
      2. 9.7.2. Solution
      3. 9.7.3. How It Works
    8. 9.8. Serializing Proxies in a WCF Service
      1. 9.8.1. Problem
      2. 9.8.2. Solution
      3. 9.8.3. How It Works
    9. 9.9. Serializing Self-Tracking Entities in the ViewState
      1. 9.9.1. Problem
      2. 9.9.2. Solution
      3. 9.9.3. How It Works
    10. 9.10. Fixing Duplicate References on a WCF Client
      1. 9.10.1. Problem
      2. 9.10.2. Solution
      3. 9.10.3. How It Works
  15. 10. Stored Procedures
    1. 10.1. Returning an Entity Collection
      1. 10.1.1. Problem
      2. 10.1.2. Solution
      3. 10.1.3. How It Works
    2. 10.2. Returning Output Parameters
      1. 10.2.1. Problem
      2. 10.2.2. Solution
      3. 10.2.3. How It Works
    3. 10.3. Returning a Scalar Value Result Set
      1. 10.3.1. Problem
      2. 10.3.2. Solution
      3. 10.3.3. How It Works
    4. 10.4. Returning a Complex Type from a Stored Procedure
      1. 10.4.1. Problem
      2. 10.4.2. Solution
      3. 10.4.3. How It Works
    5. 10.5. Defining a Custom Function in the Storage Model
      1. 10.5.1. Problem
      2. 10.5.2. Solution
      3. 10.5.3. How It Works
    6. 10.6. Populating Entities in a Table per Type Inheritance Model
      1. 10.6.1. Problem
      2. 10.6.2. Solution
      3. 10.6.3. How It Works
    7. 10.7. Populating Entities in a Table per Hierarchy Inheritance Model
      1. 10.7.1. Problem
      2. 10.7.2. Solution
      3. 10.7.3. How It Works
    8. 10.8. Mapping the Insert, Update, and Delete Actions to Stored Procedures
      1. 10.8.1. Problem
      2. 10.8.2. Solution
      3. 10.8.3. How It Works
    9. 10.9. Using Stored Procedures for the Insert and Delete Actions in a Many-to-Many Association
      1. 10.9.1. Problem
      2. 10.9.2. Solution
      3. 10.9.3. How It Works
    10. 10.10. Mapping the Insert, Update, and Delete Actions to Stored Procedures for Table per Hierarchy Inheritance
      1. 10.10.1. Problems
      2. 10.10.2. Solution
      3. 10.10.3. How It Works
  16. 11. Functions
    1. 11.1. Returning a Scalar Value from a Model Defined Function
      1. 11.1.1. Problem
      2. 11.1.2. Solution
      3. 11.1.3. How It Works
    2. 11.2. Filtering an Entity Collection Using a Model Defined Function
      1. 11.2.1. Problem
      2. 11.2.2. Solution
      3. 11.2.3. How It Works
    3. 11.3. Returning a Computed Column from a Model Defined Function
      1. 11.3.1. Problem
      2. 11.3.2. Solution
      3. 11.3.3. How It Works
    4. 11.4. Calling a Model Defined Function from a Model Defined Function
      1. 11.4.1. Problem
      2. 11.4.2. Solution
      3. 11.4.3. How It Works
    5. 11.5. Returning an Anonymous Type From a Model Defined Function
      1. 11.5.1. Problem
      2. 11.5.2. Solution
      3. 11.5.3. How It Works
    6. 11.6. Returning a Complex Type From a Model Defined Function
      1. 11.6.1. Problem
      2. 11.6.2. Solution
      3. 11.6.3. How It Works
    7. 11.7. Returning a Collection of Entity References From a Model Defined Function
      1. 11.7.1. Problem
      2. 11.7.2. Solution
      3. 11.7.3. How It Works
    8. 11.8. Using Canonical Functions in eSQL
      1. 11.8.1. Problem
      2. 11.8.2. Solution
      3. 11.8.3. How It Works
    9. 11.9. Using Canonical Functions in LINQ
      1. 11.9.1. Problem
      2. 11.9.2. Solution
      3. 11.9.3. How It Works
    10. 11.10. Calling Database Functions in eSQL
      1. 11.10.1. Problem
      2. 11.10.2. Solution
      3. 11.10.3. How It Works
    11. 11.11. Calling Database Functions in LINQ
      1. 11.11.1. Problem
      2. 11.11.2. Solution
      3. 11.11.3. How It Works
    12. 11.12. Defining Built-in Functions
      1. 11.12.1. Problem
      2. 11.12.2. Solution
      3. 11.12.3. How It Works
  17. 12. Customizing Entity Framework Objects
    1. 12.1. Executing Code When SaveChanges() Is Called
      1. 12.1.1. Problem
      2. 12.1.2. Solution
      3. 12.1.3. How It Works
    2. 12.2. Validating Property Changes
      1. 12.2.1. Problem
      2. 12.2.2. Solution
      3. 12.2.3. How It Works
    3. 12.3. Logging Database Connections
      1. 12.3.1. Problem
      2. 12.3.2. Solution
      3. 12.3.3. How It Works
    4. 12.4. Recalculating a Property Value When an Entity Collection Changes
      1. 12.4.1. Problem
      2. 12.4.2. Solution
      3. 12.4.3. How It Works
    5. 12.5. Automatically Deleting Related Entities
      1. 12.5.1. Problem
      2. 12.5.2. Solution
      3. 12.5.3. How It Works
    6. 12.6. Deleting All Related Entities
      1. 12.6.1. Problem
      2. 12.6.2. Solution
      3. 12.6.3. How It Works
    7. 12.7. Assigning Default Values
      1. 12.7.1. Problem
      2. 12.7.2. Solution
      3. 12.7.3. How It Works
    8. 12.8. Retrieving the Original Value of a Property
      1. 12.8.1. Problem
      2. 12.8.2. Solution
      3. 12.8.3. How It Works
    9. 12.9. Retrieving the Original Association for Independent Associations
      1. 12.9.1. Problem
      2. 12.9.2. Solution
      3. 12.9.3. How It Works
    10. 12.10. Retrieving XML
      1. 12.10.1. Problem
      2. 12.10.2. Solution
      3. 12.10.3. How It Works
    11. 12.11. Applying Server-Generated Values to Properties
      1. 12.11.1. Problem
      2. 12.11.2. Solution
      3. 12.11.3. How It Works
    12. 12.12. Validating Entities on SavingChanges
      1. 12.12.1. Problem
      2. 12.12.2. Solution
      3. 12.12.3. How It Works
  18. 13. Improving Performance
    1. 13.1. Optimizing Queries in a Table per Type Inheritance Model
      1. 13.1.1. Problem
      2. 13.1.2. Solution
      3. 13.1.3. How It Works
    2. 13.2. Retrieving a Single Entity Using an Entity Key
      1. 13.2.1. Problem
      2. 13.2.2. Solution
      3. 13.2.3. How It Works
    3. 13.3. Retrieving Entities for Read Only
      1. 13.3.1. Problem
      2. 13.3.2. Solution
      3. 13.3.3. How It Works
    4. 13.4. Improving the Startup Time
      1. 13.4.1. Problem
      2. 13.4.2. Solution
      3. 13.4.3. How It Works
    5. 13.5. Efficiently Building a Search Query
      1. 13.5.1. Problem
      2. 13.5.2. Solution
      3. 13.5.3. How It Works
    6. 13.6. Making Change Tracking with POCO Faster
      1. 13.6.1. Problem
      2. 13.6.2. Solution
      3. 13.6.3. How It Works
    7. 13.7. Compiling LINQ Queries
      1. 13.7.1. Problem
      2. 13.7.2. Solution
      3. 13.7.3. How It Works
    8. 13.8. Returning Partially Filled Entities
      1. 13.8.1. Problem
      2. 13.8.2. Solution
      3. 13.8.3. How It Works
    9. 13.9. Moving an Expensive Property to Another Entity
      1. 13.9.1. Problem
      2. 13.9.2. Solution
      3. 13.9.3. How It Works
    10. 13.10. Avoiding Include
      1. 13.10.1. Problem
      2. 13.10.2. Solution
      3. 13.10.3. How It Works
    11. 13.11. Improving QueryView Performance
      1. 13.11.1. Problem
      2. 13.11.2. Solution
      3. 13.11.3. How It Works
    12. 13.12. Generating Proxies Explicitly
      1. 13.12.1. Problem
      2. 13.12.2. Solution
      3. 13.12.3. How It Works
    13. 13.13. Preventing the Update of All Columns in Self-Tracking Entities
      1. 13.13.1. Problem
      2. 13.13.2. Solution
      3. 13.13.3. How It Works
  19. 14. Concurrency
    1. 14.1. Applying Optimistic Concurrency
      1. 14.1.1. Problem
      2. 14.1.2. Solution
      3. 14.1.3. How It Works
    2. 14.2. Managing Concurrency When Using Stored Procedures
      1. 14.2.1. Problem
      2. 14.2.2. Solution
      3. 14.2.3. How It Works
    3. 14.3. Reading Uncommitted Data
      1. 14.3.1. Problem
      2. 14.3.2. Solution
      3. 14.3.3. How It Works
    4. 14.4. Implementing the "Last Record Wins" Strategy
      1. 14.4.1. Problem
      2. 14.4.2. Solution
      3. 14.4.3. How It Works
    5. 14.5. Getting Affected Rows from a Stored Procedure
      1. 14.5.1. Problem
      2. 14.5.2. Solution
      3. 14.5.3. How It Works
    6. 14.6. Optimistic Concurrency with Table Per Type Inheritance
      1. 14.6.1. Problem
      2. 14.6.2. Solution
      3. 14.6.3. How It Works
    7. 14.7. Generating a Timestamp Column with Model First
      1. 14.7.1. Problem
      2. 14.7.2. Solution
      3. 14.7.3. How It Works
  20. 15. Advanced Modeling
    1. 15.1. Creating an Association on a Derived Entity
      1. 15.1.1. Problem
      2. 15.1.2. Solution
      3. 15.1.3. How It Works
    2. 15.2. Mapping an Entity to Customized Parts of One or More Tables
      1. 15.2.1. Problem
      2. 15.2.2. Solution
      3. 15.2.3. How It Works
    3. 15.3. Creating Conditional Associations
      1. 15.3.1. Problem
      2. 15.3.2. Solution
      3. 15.3.3. How It Works
    4. 15.4. Fabricating Additional Inheritance Hierarchies
      1. 15.4.1. Problem
      2. 15.4.2. Solution
      3. 15.4.3. How It Works
    5. 15.5. Sharing Audit Fields Across Multiple Entities
      1. 15.5.1. Problem
      2. 15.5.2. Solution
      3. 15.5.3. How It Works
    6. 15.6. Modeling a Many-to-Many Relationship with Payload
      1. 15.6.1. Problem
      2. 15.6.2. Solution
      3. 15.6.3. How It Works
    7. 15.7. Mapping a Foreign Key Column to Multiple Associations
      1. 15.7.1. Problem
      2. 15.7.2. Solution
      3. 15.7.3. How It Works
    8. 15.8. Using Inheritance to Map a Foreign Key Column to Multiple Associations
      1. 15.8.1. Problem
      2. 15.8.2. Solution
      3. 15.8.3. How It Works
    9. 15.9. Creating Read-only and Computed Properties
      1. 15.9.1. Problem
      2. 15.9.2. Solution
      3. 15.9.3. How It Works
    10. 15.10. Mapping an Entity to Multiple Tables
      1. 15.10.1. Problem
      2. 15.10.2. Solution
      3. 15.10.3. How It Works
    11. 15.11. Mapping an Entity to Multiple Entity Sets (MEST)
      1. 15.11.1. Problem
      2. 15.11.2. Solution
      3. 15.11.3. How It Works
    12. 15.12. Extending Table per Type with Table per Hierarchy
      1. 15.12.1. Problem
      2. 15.12.2. Solution
      3. 15.12.3. How It Works