1. Redefining your data-access strategy
Chapter 1. Data access reloaded: Entity Framework
1.1. Getting started with data access
1.2. Developing applications using database-like structures
1.2.1. Using datasets and data readers as data containers
1.2.2. The strong coupling problem
1.3. Using classes to organize data
1.4. Delving deep into object/relational differences
1.4.2. The association mismatch
1.4.3. The granularity mismatch
1.5. Letting Entity Framework ease your life
1.6. How Entity Framework performs data access
Chapter 2. Getting started with Entity Framework
2.1. Introducing the OrderIT example
2.2. Designing the OrderIT model and database
2.2.1. Bottom-up vs. top-down design
2.3. Structuring the application
2.3.1. Creating the assemblies
2.3.2. Designing entities using the database-first approach
2.3.3. Designing relationships
Chapter 3. Querying the object model: the basics
3.1. One engine, many querying methods
3.2. The query engine entry point: Object Services
3.2.1. Setting up the connection string
3.2.2. Writing queries against classes
3.2.3. LINQ to Entities queries vs. standard LINQ queries
3.2.4. Retrieving data from the database
3.2.5. Understanding Identity Map in the context
3.2.6. Understanding interaction between Object Services and Entity Client
3.2.7. Capturing the generated SQL
3.2.8. Understanding which entities are returned by a query
Chapter 4. Querying with LINQ to Entities
4.6. Querying with inheritance
4.8. Executing handmade queries
Chapter 5. Domain model mapping
5.2. Creating consumable entities
5.2.2. Describing entities in the conceptual schema
5.3. Defining relationships in the model
5.3.1. One-to-one relationships
5.3.2. One-to-many relationships
5.5. Extending the EDM with custom annotations
Chapter 6. Understanding the entity lifecycle
6.1.1. Understanding entity state
6.2.3. The ApplyCurrentValues and ApplyOriginalValues methods
6.2.4. The DeleteObject method
6.2.5. The AcceptAllChanges method
6.3. Managing change tracking with ObjectStateManager
6.3.1. The ObjectStateEntry class
6.3.3. Modifying entity state from the entry
6.3.4. Understanding object tracking
Chapter 7. Persisting objects into the database
7.1. Persisting entities with SaveChanges
7.1.1. Detecting dirty entities
7.1.2. Starting database transactions
7.1.3. SQL code generation and execution
7.2. Persisting changed entities into the database
7.2.1. Persisting an entity as a new row
7.3. Persisting entities graphs
7.3.1. Persisting a graph of added entities
7.3.2. Persisting modifications made to a graph
7.4. A few tricks about persistence
Chapter 8. Handling concurrency and transactions
8.1. Understanding the concurrency problem
8.1.1. The concurrent updates scenario
8.1.2. A first solution: pessimistic concurrency control
8.1.3. A better solution: optimistic concurrency control
8.1.4. The halfway solution: pessimistic/optimistic concurrency control
8.2. Handling concurrency in Entity Framework
8.2.1. Enabling optimistic concurrency checking
8.2.2. Optimistic concurrency in action
Chapter 9. An alternative way of querying: Entity SQL
9.8. Using query-builder methods
9.9. Working with the Entity Client data provider
9.9.1. Connecting with EntityConnection
9.9.2. Executing queries with EntityCommand
Chapter 10. Working with stored procedures
10.1. Mapping stored procedures
10.2. Returning data with stored procedures
10.2.1. Stored procedures whose results match an entity
10.2.2. Stored procedures whose results don’t match an entity
10.2.3. Stored procedures that return scalar values
10.2.4. Stored procedures that return an inheritance hierarchy
10.3. Embedding functions in the storage model
10.4. Updating data with stored procedures
10.4.1. Using stored procedures to persist an entity
10.4.2. Using stored procedures to update an entity with concurrency
10.4.3. Persisting an entity that’s in an inheritance hierarchy
10.4.4. Upgrading and downgrading an entity that’s in an inheritance hierarchy
10.4.5. Executing stored procedures not connected to an entity
Chapter 11. Working with functions and views
11.1. Views in the storage model: defining queries
11.1.1. Creating a defining query
11.1.2. Mapping stored procedures to classes with complex properties
11.2. User-defined functions and scalar-valued functions
11.2.1. Scalar-valued functions
Chapter 12. Exploring EDM metadata
12.3. Building a metadata explorer
12.4. Writing generic code with metadata
12.4.1. Adding or attaching an object based on custom annotations
Chapter 13. Customizing code and the designer
13.1. How Visual Studio generates classes
13.1.1. Understanding template tags
13.2. Customizing class generation
13.2.1. Understanding the available POCO template
13.2.2. Generating user-defined and scalar-valued functions
13.3. How Visual Studio generates database DDL
13.4. Customizing DDL generation
13.4.1. Understanding the conceptual-to-storage template
13.4.2. Understanding the conceptual-to-mapping template
13.4.3. Understanding the storage-to-database script template
13.5. Creating designer extensions
13.5.1. How the property-extension mechanism works
13.5.2. Setting up the project containing the extension
13.5.3. Creating the property class
13.5.4. Creating the factory class
13.5.5. Creating the manifest extension file
13.5.6. Installing, debugging, and uninstalling the extension
Chapter 14. Designing the application around Entity Framework
14.1. The application design process
14.2. A typical three-layer architecture
14.2.1. Filling the product list
14.2.2. Calculating order totals and saving them to the database
14.3. Principles of domain-driven design
14.3.3. Handling associations correctly: domain roots and aggregates
14.4. Retrieving references to a domain’s entities
14.4.1. Repositories at a glance
Chapter 15. Entity Framework and ASP.NET
15.1. EntityDataSource, a new approach to data binding
15.2. Using Dynamic Data controls with Entity Framework
15.3. The ObjectContext lifecycle in ASP.NET
15.3.1. The Context-per-Request pattern
15.4. Common scenarios involving ASP.NET and Entity Framework
Chapter 16. Entity Framework and n-tier development
16.1. n-Tier problems and solutions
16.1.1. Tracking changes made on the client
16.1.2. Choosing data to be exchanged between server and client
16.2. Developing a service using entities as contracts
16.2.1. Persisting a complex graph
16.3. Developing a service using DTOs
16.4. Developing a service using STEs
Chapter 17. Entity Framework and Windows applications
17.2. Designing model classes for binding
17.2.1. Implementing INotifyPropertyChanged
17.2.2. Implementing IEditableObject
17.3. Binding in Windows Forms applications
17.3.2. Showing data for the selected order
17.3.3. Showing details of the selected order
17.3.4. Showing selected detail information
17.4. Binding in WPF applications
17.4.2. Showing data for the selected order
17.4.3. Showing selected order details
Chapter 18. Testing Entity Framework
18.2. Writing a test suite in Visual Studio 2010
18.2.1. Testing a simple method
18.2.2. Advanced features of Microsoft’s Unit Testing Framework
18.4. Unit-testing the data access layer
Chapter 19. Keeping an eye on performance
19.1. Testing configuration and environment
19.2. Database-writing comparison
19.3. Query comparisons in the default environment
19.4.2. Compiling LINQ to Entities queries
19.4.3. Enabling plan caching for Entity SQL
Appendix A. Understanding LINQ
Appendix B. Entity Framework tips and tricks
B.1. A smart way of attaching entities
B.2. Building an auditing system
B.2.1. Creating an attribute to mark auditable entities
B.2.2. Customizing the designer
B.2.3. Customizing the template that generates entities
B.2.4. Overriding the persistence process with a custom context
B.3. Two tips for querying data
18.221.126.56