SlideShare a Scribd company logo
ADO.NET Entity Framework in Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 Eric Nelson  [email_address] http://geekswithblogs.net/iupdateable   http://twitter.com/ericnel   Developer Evangelist Microsoft UK Advert Alert  http://ukazure.ning.com
Agenda Swift intro to Entity Framework Entity Framework 4.0 Drill Down Lots of demos
Why an ORM? Why Entity Framework?
Why an ORM? Why Entity Framework?
ADO.NET Entity Framework Recap Tools and services to  create an Entity Data Model (EDM) Conceptual to Mapping to Storage Tools and services for  consuming an Entity Data Model LINQ to Entities, Object Services and Entity SQL Together they address the  “impedance mismatch”  Rows in  Tables Objects in  Applications Conceptual Mapping Storage Entity Data Model
Model First and Templated Code Generation
Entity Framework 1.0 Features Generate model from database schema Very rich mapping layer Inheritance, rename, aggregate, filter Simplified CRUD operations LINQ querying* Worked with many databases Database agnostic query language SP support for data retrieval/modification* Designer* Strategic!
Entity Framework 1.0 - Too many pain points The designer! Model First not supported Poor support for Stored Procedures No Pluralization/Singularization Foreign Keys hidden Lazy Loading not supported Missing LINQ Operators vs LINQ to SQL Generated SQL unreadable No support for Plain Old CLR Objects N-Tier difficult
Entity Framework 4.0
New in ADO.NET Entity Framework 4.0 Model-first development Automatic pluralization Foreign keys in models POCO class support (Add-in) Lazy loading T4 Code Generation Template customization IObjectSet Virtual SaveChanges ObjectStateManager control Self-tracking entities SQL generation improvements More LINQ operator support LINQ extensibility ExecuteStoreQuery ExecuteStoreCommand SPROC import improvements Model defined functions WPF designer integration Code-First development (Feature CTP)
Entity Framework 4.0 -  Removing the friction Better Tools and Design Experience More powerful/flexible runtime And Persistence Ignorance* N-Tier Code First* Note: * Delivered in a separate download
Better Tools and Design Experience Model First Templated code generation Stored Procedures Pluralization/Singularization  Complex Types Better delete and search
Model First and Templated Code Generation
More powerful/flexible runtime Lazy loading Foreign Keys surfaced More complete LINQ implementation ExecuteStoreQuery EntityFunctions and SqlFunctions Improvements to generated SQL
Deferred Loading, Generated SQL
http://blogs.msdn.com/adonet/archive/2009/08/05/improvements-to-the-generated-sql-in-net-4-0-beta1.aspx
Feature Pack / Add-Ins Separate downloads Feature Pack Code First support Add-In T4 Template for Persistence Ignorance/POCO
Persistence Ignorance/POCO First class support for Persistence Ignorance  No modifications to your classes!
N-Tier
Code First (was Code Only) Create the database from the classes No model Convention to config
Database First / Model First / CodeOnly Database First (EF v1) Model First Code First
Code Only
N-Tier (Self Tracking Entities) Service public   class   NorthwindService  :  INorthwindService { public   Customer  GetCustomer( string  id) { using  ( var  ctx =  new   NorthwindEntities ()) { return  ctx.Customers.Include( "Orders" ) .Where(c => c.CustomerID == id) .SingleOrDefault(); } } public   bool  SubmitOrder( Order  newOrder) { using  ( var  ctx =  new   NorthwindEntities ()) { ctx.Orders.ApplyChanges(newOrder); ValidateOrderGraph(ctx, newOrder); return  ctx.SaveChanges() >  0 ; } } } Client static   bool  ValidSTEUpdate( INorthwindService  svc) { var  customer = svc.GetCustomer( "ALFKI" ); // modify contact name of customer customer.ContactName +=  "+" ; // add a new order var  newOrder =  new   Order (); newOrder.Order_Details.Add( new   Order_Detail ()  {  ProductID = products.Where(p => p.ProductName    ==  "Chai" ).Single().ProductID, Quantity =  1   }); customer.Orders.Add(newOrder); return  svc.SubmitOrder(newOrder); } Danny Simmons MSDN Article: Building N-Tier Apps with EF4 http://code.msdn.microsoft.com/mag200911EF4  http://msdn.microsoft.com/en-gb/magazine/ee335715.aspx
Entity Framework  The designer! No support for Plain Old CLR Objects No Pluralization/Singularization Foreign Keys hidden Model First not supported Lazy Loading not supported Missing LINQ Operators vs LINQ to SQL Generated SQL unreadable N-Tier difficult Poor support for Stored Procedures
Summary Entity Framework 4.0 is rather nice! We continue to listen and improve Resources http://bit.ly/ericnelson   Entity Framework 4.0 Resources  http://bit.ly/ef4resources   Entity Framework Team Blog http://blogs.msdn.com/adonet/ Entity Framework Design Blog  http://blogs.msdn.com/efdesign/
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation.  Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation.  MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. Required Slide

More Related Content

PPTX
Lerman Vvs13 Entity Framework 4 And Wcf
PPTX
Lerman Adx303 Entity Framework 4 In Aspnet
PPT
Introduction To Dotnet
PPTX
Asp.net and .Net Framework ppt presentation
PPTX
.NET and C# introduction
PPT
Programming in c#
PPTX
Brief history of web components
PDF
Core JavaScript
Lerman Vvs13 Entity Framework 4 And Wcf
Lerman Adx303 Entity Framework 4 In Aspnet
Introduction To Dotnet
Asp.net and .Net Framework ppt presentation
.NET and C# introduction
Programming in c#
Brief history of web components
Core JavaScript

What's hot (19)

PPT
Codeigniter
PPTX
Dotnet Basics Presentation
PPTX
4. features of .net
PPT
PDF
Dot net syllabus book
PPT
LINQ in Visual Studio 2008
PPT
c#.Net Windows application
PDF
BCA IPU VB.NET UNIT-I
PPTX
Code Generation using T4
PDF
Introduction au Web
PPTX
Flash Testing with Selenium RC
PPTX
Building n-Tier ASP.NET WebForms with Entity Framework 4, Lerman
PPTX
Building modular enterprise scale angular js applications
PPT
.Net Overview -- Training (Lesson 1)
PPT
Php Frameworks
PPT
Yii php framework_honey
PPTX
Program Verification / Automated Theorem Proving
PPTX
EF6 or EF Core? How Do I Choose?
PPT
ASP.NET Training Syllabus Course
Codeigniter
Dotnet Basics Presentation
4. features of .net
Dot net syllabus book
LINQ in Visual Studio 2008
c#.Net Windows application
BCA IPU VB.NET UNIT-I
Code Generation using T4
Introduction au Web
Flash Testing with Selenium RC
Building n-Tier ASP.NET WebForms with Entity Framework 4, Lerman
Building modular enterprise scale angular js applications
.Net Overview -- Training (Lesson 1)
Php Frameworks
Yii php framework_honey
Program Verification / Automated Theorem Proving
EF6 or EF Core? How Do I Choose?
ASP.NET Training Syllabus Course
Ad

Similar to Entity Framework 4 In Microsoft Visual Studio 2010 (20)

PPTX
Entity Framework 4 In Microsoft Visual Studio 2010 - ericnel
PPTX
Entity Framework 4
PPTX
Entity Framework v1 and v2
PPTX
Building nTier Applications with Entity Framework Services (Part 1)
PPTX
Building N Tier Applications With Entity Framework Services 2010
PPTX
Building nTier Applications with Entity Framework Services (Part 1)
PPTX
05 entity framework
PPTX
Entity Framework V1 and V2
PPTX
Entity framework
PPTX
Building nTier Applications with Entity Framework Services
PPTX
Microsoft Data Access Technologies
PPT
What's New for Data?
PPTX
Entity Framework NYC Firestarter
PPTX
Applying EF Code First at Your Job
PPTX
Entity framework and how to use it
PDF
Entity Framework 6 Recipes 2nd Edition Brian Driscoll
PPTX
Entity Framework Overview
PPTX
Entity Framework For DBAs
PPTX
Entity Framework Today (May 2012)
PPTX
Real World API Design Using The Entity Framework Services
Entity Framework 4 In Microsoft Visual Studio 2010 - ericnel
Entity Framework 4
Entity Framework v1 and v2
Building nTier Applications with Entity Framework Services (Part 1)
Building N Tier Applications With Entity Framework Services 2010
Building nTier Applications with Entity Framework Services (Part 1)
05 entity framework
Entity Framework V1 and V2
Entity framework
Building nTier Applications with Entity Framework Services
Microsoft Data Access Technologies
What's New for Data?
Entity Framework NYC Firestarter
Applying EF Code First at Your Job
Entity framework and how to use it
Entity Framework 6 Recipes 2nd Edition Brian Driscoll
Entity Framework Overview
Entity Framework For DBAs
Entity Framework Today (May 2012)
Real World API Design Using The Entity Framework Services
Ad

More from Eric Nelson (20)

PPT
SQL Azure Dec 2010 Update
PPT
SQL Azure Dec Update
PPT
Windows Azure Platform in 30mins by ericnel
PPTX
Technology Roadmap by ericnel
PPTX
Windows Azure Platform in 30mins by ericnel
PDF
10 things ever architect should know about the Windows Azure Platform - ericnel
PDF
Lap around the Windows Azure Platform - ericnel
PDF
Windows Azure Platform best practices by ericnel
PDF
Windows Azure Platform: Articles from the Trenches, Volume One
PPT
Looking at the clouds through dirty windows
PPT
SQL Azure Overview for Bizspark day
PPT
Building An Application For Windows Azure And Sql Azure
PPTX
Windows Azure In 30mins for none technical audience
PPT
Dev305 Entity Framework 4 Emergency Slides
PPTX
Design Considerations For Storing With Windows Azure
PPTX
What Impact Will Entity Framework Have On Architecture
PPTX
Windows Azure Overview
PPTX
SQL Data Service Overview
PPTX
Entity Framework Overview
PPT
SQL Server 2008 Overview
SQL Azure Dec 2010 Update
SQL Azure Dec Update
Windows Azure Platform in 30mins by ericnel
Technology Roadmap by ericnel
Windows Azure Platform in 30mins by ericnel
10 things ever architect should know about the Windows Azure Platform - ericnel
Lap around the Windows Azure Platform - ericnel
Windows Azure Platform best practices by ericnel
Windows Azure Platform: Articles from the Trenches, Volume One
Looking at the clouds through dirty windows
SQL Azure Overview for Bizspark day
Building An Application For Windows Azure And Sql Azure
Windows Azure In 30mins for none technical audience
Dev305 Entity Framework 4 Emergency Slides
Design Considerations For Storing With Windows Azure
What Impact Will Entity Framework Have On Architecture
Windows Azure Overview
SQL Data Service Overview
Entity Framework Overview
SQL Server 2008 Overview

Recently uploaded (20)

PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
August Patch Tuesday
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Machine learning based COVID-19 study performance prediction
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Getting Started with Data Integration: FME Form 101
PPTX
1. Introduction to Computer Programming.pptx
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PDF
Empathic Computing: Creating Shared Understanding
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Diabetes mellitus diagnosis method based random forest with bat algorithm
August Patch Tuesday
Assigned Numbers - 2025 - Bluetooth® Document
Encapsulation_ Review paper, used for researhc scholars
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
A comparative analysis of optical character recognition models for extracting...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Machine learning based COVID-19 study performance prediction
A comparative study of natural language inference in Swahili using monolingua...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
SOPHOS-XG Firewall Administrator PPT.pptx
Univ-Connecticut-ChatGPT-Presentaion.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Getting Started with Data Integration: FME Form 101
1. Introduction to Computer Programming.pptx
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Empathic Computing: Creating Shared Understanding
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...

Entity Framework 4 In Microsoft Visual Studio 2010

  • 1. ADO.NET Entity Framework in Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 Eric Nelson [email_address] http://geekswithblogs.net/iupdateable http://twitter.com/ericnel Developer Evangelist Microsoft UK Advert Alert http://ukazure.ning.com
  • 2. Agenda Swift intro to Entity Framework Entity Framework 4.0 Drill Down Lots of demos
  • 3. Why an ORM? Why Entity Framework?
  • 4. Why an ORM? Why Entity Framework?
  • 5. ADO.NET Entity Framework Recap Tools and services to create an Entity Data Model (EDM) Conceptual to Mapping to Storage Tools and services for consuming an Entity Data Model LINQ to Entities, Object Services and Entity SQL Together they address the “impedance mismatch” Rows in Tables Objects in Applications Conceptual Mapping Storage Entity Data Model
  • 6. Model First and Templated Code Generation
  • 7. Entity Framework 1.0 Features Generate model from database schema Very rich mapping layer Inheritance, rename, aggregate, filter Simplified CRUD operations LINQ querying* Worked with many databases Database agnostic query language SP support for data retrieval/modification* Designer* Strategic!
  • 8. Entity Framework 1.0 - Too many pain points The designer! Model First not supported Poor support for Stored Procedures No Pluralization/Singularization Foreign Keys hidden Lazy Loading not supported Missing LINQ Operators vs LINQ to SQL Generated SQL unreadable No support for Plain Old CLR Objects N-Tier difficult
  • 10. New in ADO.NET Entity Framework 4.0 Model-first development Automatic pluralization Foreign keys in models POCO class support (Add-in) Lazy loading T4 Code Generation Template customization IObjectSet Virtual SaveChanges ObjectStateManager control Self-tracking entities SQL generation improvements More LINQ operator support LINQ extensibility ExecuteStoreQuery ExecuteStoreCommand SPROC import improvements Model defined functions WPF designer integration Code-First development (Feature CTP)
  • 11. Entity Framework 4.0 - Removing the friction Better Tools and Design Experience More powerful/flexible runtime And Persistence Ignorance* N-Tier Code First* Note: * Delivered in a separate download
  • 12. Better Tools and Design Experience Model First Templated code generation Stored Procedures Pluralization/Singularization Complex Types Better delete and search
  • 13. Model First and Templated Code Generation
  • 14. More powerful/flexible runtime Lazy loading Foreign Keys surfaced More complete LINQ implementation ExecuteStoreQuery EntityFunctions and SqlFunctions Improvements to generated SQL
  • 17. Feature Pack / Add-Ins Separate downloads Feature Pack Code First support Add-In T4 Template for Persistence Ignorance/POCO
  • 18. Persistence Ignorance/POCO First class support for Persistence Ignorance No modifications to your classes!
  • 20. Code First (was Code Only) Create the database from the classes No model Convention to config
  • 21. Database First / Model First / CodeOnly Database First (EF v1) Model First Code First
  • 23. N-Tier (Self Tracking Entities) Service public class NorthwindService : INorthwindService { public Customer GetCustomer( string id) { using ( var ctx = new NorthwindEntities ()) { return ctx.Customers.Include( "Orders" ) .Where(c => c.CustomerID == id) .SingleOrDefault(); } } public bool SubmitOrder( Order newOrder) { using ( var ctx = new NorthwindEntities ()) { ctx.Orders.ApplyChanges(newOrder); ValidateOrderGraph(ctx, newOrder); return ctx.SaveChanges() > 0 ; } } } Client static bool ValidSTEUpdate( INorthwindService svc) { var customer = svc.GetCustomer( "ALFKI" ); // modify contact name of customer customer.ContactName += "+" ; // add a new order var newOrder = new Order (); newOrder.Order_Details.Add( new Order_Detail () { ProductID = products.Where(p => p.ProductName == "Chai" ).Single().ProductID, Quantity = 1 }); customer.Orders.Add(newOrder); return svc.SubmitOrder(newOrder); } Danny Simmons MSDN Article: Building N-Tier Apps with EF4 http://code.msdn.microsoft.com/mag200911EF4 http://msdn.microsoft.com/en-gb/magazine/ee335715.aspx
  • 24. Entity Framework The designer! No support for Plain Old CLR Objects No Pluralization/Singularization Foreign Keys hidden Model First not supported Lazy Loading not supported Missing LINQ Operators vs LINQ to SQL Generated SQL unreadable N-Tier difficult Poor support for Stored Procedures
  • 25. Summary Entity Framework 4.0 is rather nice! We continue to listen and improve Resources http://bit.ly/ericnelson Entity Framework 4.0 Resources http://bit.ly/ef4resources Entity Framework Team Blog http://blogs.msdn.com/adonet/ Entity Framework Design Blog http://blogs.msdn.com/efdesign/
  • 26. © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. Required Slide

Editor's Notes

  • #2: Tech·Ed  North America 2009 03/21/10 16:39 © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
  • #4: Look at the problems that EF addresses: - opaque database commands buried in strings - tedious, repetitive code to materialise objects Create connection SQL String – embedded joins DataReader – not type safe
  • #5: Type safe code No joins as we’ve abstracted away the database representation. (If we had joins then the compiler could verify them) Familiar query syntax (L2O, L2Xml, ...) Working with objects
  • #7: 03/21/10 16:39 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
  • #8: Some of the features of EF v1... Abstract the db model. Get a richer object/entity model to work with in the application. Isolate from change. Work with objects not tables. Have object relationships. Type-safe queries. Easy to query across relationships (just access properties on the objects!). Compile-time checking. Pretty good start, some rough areas. Mention vote of no confidence
  • #10: Yep, apparently “4” is the number after “1” in marketing ;-) Aligning version numbers with .NET 4, C#4. Don’t be alarmed if you see a reference to EF4!
  • #13: Code Gen In V1 we had EntityClassGenerator which could be configured using events Hard (it used CodeDom) Inflexible (not much control) In V2 we will have TemplatedEntityClassGenerator and will ship default T4 templates Customization via Tools Uses Workflow Foundation Complex types Pluralization Public abstract PluralizationService Default implementation is English Only Default rules: EntityTypes / ComplexTypes are singularized EntitySets are pluralized Navigation Properties based on cardinality Stored Procedures Stored Procedures as functions Mapping support for stored procedure result Complex type as return type Scalar and void return type Entity CUD using Stored Procedures No need to have SPs for all CUD
  • #14: 03/21/10 16:39 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
  • #15: Foreign Keys Independent Association – v1   Product p = new Product { ID = 1,       Name = "Bovril",       Category = context.Categories                         .Single(c => c.Name == "Food") }; context.SaveChanges(); FK Association – v2 Product p = new Product     {         ID = 1,         Name = "Bovril",         CategoryID = 13     };      context.Products.AddObject(p);     context.SaveChanges(); Deferred Loading Can do lazy load Context.deferredloading=true Model Level using ESQL <Function Name=“CustomerFullName” ReturnType=“String”> <Parameter Name=“customer” Type=“MyModel.customer”> <DefiningExpression> customer.FirstName + ‘ ‘ + customer.LastName </DefiningExpression> </Function> Enables from c in ctx.Customers select c.FullName() CLR Level [EdmFunction("MyModel", "CustomerFullName")] public static string FullName(this customer c) { return String.Format("{0} {1}", c.FirstName, c.LastName); } Enables Console.WriteLine(c.FullName()); Inline Functions in ESQL   using Northwind; function AmountPurchased(c Customer) as Sum (c.Sales.Amt) function AmountReturned(c Customer) as Sum (c.Returns.Amt) function AmountConsumed(c Customer) as                                                                       AmountPurchased(c) – AmountReturned(c) select AmountConsumed(c) from Customers as c;
  • #16: 03/21/10 16:39 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
  • #18: Before going continuing, should mention the Feature Pack. Not all of the features I’m covering here will be in EF4 RTM, some (as mentioned in slide) will form the Feature Pack…
  • #20: 03/21/10 16:39 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
  • #21: Code Only No XML files, no model! Convention to config E.g. Convention: xxxID to a primary key, schema=dbo E.g. Config: On map to schema sys and class property to table column [TableMapping(Schema=“sys”,TableName=“MyDBTable”] [ColumnMapping(PropertyName=“MyClassProp1”, ColumnName=“table_column1”)] [Key(PropertyName=“MyClassProp1”)] public objectset<MyThing> MyThings...
  • #22: Db First (v1 approach) Model first. Start from scratch in designer. Generate code and database from model. Database generation is driven via a workflow that you can replace (haven’t looked at this yet!) Code first (feature pack). You create your classes in code and add some code to tell EF about the classes and their relationships. EF essentially creates a model internally and creates the database for you.
  • #23: 03/21/10 16:39 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
  • #24: N-Tier – exposing EF classes via WCF. Lots of feedback around the difficulties with detaching/reattaching object from context New API to makes this easier ( context.ObjectStateManager.ChangeRelationshipState ). Self-tracking Entities T4 template to make this even easier. Click through the example. Refer to great sample app by Danny Simmons for MSDN Magazine. N.B. Self tracking entity functionality requires type sharing between service and client
  • #27: 03/21/10 16:39 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.