2. Agenda Data Access History OO vs. Relational World EF Architecture Development Approaches EF 4.0+ New API EDM LINQ to Entities Entity SQL Conceptual Model Object Services Mapping Entity Client Provider StorageModel ADO.NET Provider
4. Services:- Change tracking- Concurrency control- Object identity SQL or Stored Procs Rows SQLServer Entity Framework Entity Framework Flow Application from c in db.Customerswhere c.City == "London"select new { c.Name, c.Phone } Objects LINQ Query SubmitChanges() EDMX ADO.NET Provider SQL Query select Name, Phonefrom customerswhere city = 'London'
5. OO vs. Relational World Data Types Associations Granularity Inheritance Identity
6. EF Architecture SQLServer EDM LINQ to Entities Entity SQL Conceptual Model Object Services Mapping Entity Client Provider StorageModel ADO.NET Provider
7. Entity Data Model (EDM) The EDM is the link between the model and the database. The EDM is that it decouples your application from the underlying store. Entity Data Model (EDM) StorageModel (SSDL) Mapping (MSL) Conceptual Model (CSDL) Storage
8.
9. Entity SQL & LINQ to Entities LINQ to Entities - The LINQ dialect that enables typed queries against the model. Entity SQL - The second way of querying the object model. Entity SQL is string-based. Can be used to retrieve data at low level, directly using the Entity Client.
10. EDM LINQ to Entities Entity SQL Conceptual Model Development Approaches Object Services Mapping Entity Client Provider StorageModel ADO.NET Provider
11. Database First DB If you already have a database, the Entity Framework can automatically generate a data model that consists of classes and properties that correspond to existing database objects such as tables and columns. Generated Data Model (.edmx) Database First
12. Model First Generated DB If you don't yet have a database, you can begin by creating a model using the Entity Framework designer in Visual Studio. The designer can generate DDL (data definition language) statements to create the database. Data Model (.edmx) Model First
13. DB Generated Data Model (Classes) Code First Code First Generated DB Whether you have an existing database or not, you can code your own classes and properties that correspond to tables and columns and use them with the Entity Framework without an .edmx file. Data Model (Classes) Code First
14. Why DbContext & DbSet? This API provides a more productive surface for working with the EF and can be used with the Code First, Database First, and Model First approaches. Model Discovery Model Caching DbSet Initialization Database Provisioning DbModelConstructor ObjectContextConstructor * More info click here
16. Features That Are Not Supported features are not supported by the DbContextAPI. To use these features, use the ObjectContextAPI. Compiled queries MEST (Multiple Entity Sets per Type) Self-tracking entities. To use the DbContext API in an N-tier application, consider using WCF Data Services or RIA Services.