SlideShare uma empresa Scribd logo
1 de 15
Entity Framework 4 & WCF So Happy Together  Julie Lerman www.thedatafarm.com jlerman@thedatafarm.com twitter @JulieLermanVT Julie Lerman: Entity Framework 4 and WCF [ESDC March 2010]
Julie Lerman website theDataFarm.com blog & twitter theDataFarm.com/blog@julielermanVT book web site LearnEntityFramework.com consultant/mentor Microsoft MVP, INETA Speaker,ASPInsider, MCP, VTdotNET Leader Julie Lerman: Entity Framework 4 and WCF [ESDC March 2010] 2nd Edition Spring 2010
Agenda New Features in EF that help with n-Tier POCO Support Foreign Keys State methods Serialization improvement	 Custom WCF Services Self-Tracking Entities Julie Lerman: Entity Framework 4 and WCF [ESDC March 2010]
EFv1 and N-Tier EntityObjects are ugly when serialized Transferring to & from DTOs is painful No change-tracking in the objects Difficult & unsatisfying WCF patterns  Julie Lerman: Entity Framework 4 and WCF [ESDC March 2010]
ObjectContext Manages Entities Julie Lerman: Entity Framework 4 and WCF [ESDC March 2010] ObjectContext Person Object State info State info Order Object State info Detail Object State info Detail Object State info Order Object State info Detail Object State info Detail Object
Hello POCO, Goodbye EntityObject Julie Lerman: Entity Framework 4 and WCF [ESDC March 2010]
Code Gen POCOs from Model T4 More in Kathleen Dollard’s 2:30 talk, Wednesday: T4: Code Generation Microsoft Style Text Template Transformation Toolkit Julie Lerman: Entity Framework 4 and WCF [ESDC March 2010]
New State Methods Support N-Tier Fix up newly attached entity’s EntityState ApplyCurrentValues ApplyOriginalValues ChangeState ChangeRelationshipState Used when there are no foreign keys Julie Lerman: Entity Framework 4 and WCF [ESDC March 2010]
Context.ApplyCurrentValues Julie Lerman: Entity Framework 4 and WCF [ESDC March 2010] Server Entity ,[object Object]
EntityState=UnchangedClient side Entity ,[object Object],ApplyCurrentValues(Client Entity)
Foreign Key Support Default with new models Simplifies relationship management Huge benefits from WCF client to service Julie Lerman: Entity Framework 4 and WCF [ESDC March 2010]
Basic Pattern for WCF in EF4 Use POCO entity classes No dynamic proxies (not virtual) Include a State property in the classes Return graphs Attach returned data to new context Fix up context state using POCO State If not using FKs Fix up relationships with help from DB data Julie Lerman: Entity Framework 4 and WCF [ESDC March 2010]
Self-Tracking Entities (! very agile) For DataSet lovers Special T4 Code Gen Template Creates POCO Classes with state info Creates additional classes & interfaces “Magically: takes care of change tracking Used in client (.NET 4.0) & service For WCF/DataContract Serialization Julie Lerman: Entity Framework 4 and WCF [ESDC March 2010]
Summary WCF was painful in EF version 1 Many improvements in EF4 to help n-Tier Writing custom WCF gets much easier Self-Tracking Entities are an out of the box solution to help DataSetdevs Don’t forget about WCF Data Services and WCF RIA Services as well Julie Lerman: Entity Framework 4 and WCF [ESDC March 2010]
Julie Lerman website theDataFarm.com blog & twitter theDataFarm.com/blog@julielermanVT book web site LearnEntityFramework.com consultant/mentor Microsoft MVP, INETA Speaker,ASPInsider, MCP, VTdotNET Leader Julie Lerman: Entity Framework 4 and WCF [ESDC March 2010] 2nd Edition Spring 2010

Mais conteúdo relacionado

Semelhante a Entity Framework 4 and WCF

Alfresco DevCon 2011. Implementing eGov Portal. Powered by Alfresco and Orbeon
Alfresco DevCon 2011. Implementing eGov Portal. Powered by Alfresco and OrbeonAlfresco DevCon 2011. Implementing eGov Portal. Powered by Alfresco and Orbeon
Alfresco DevCon 2011. Implementing eGov Portal. Powered by Alfresco and Orbeon
Oksana Kurysheva
 
Li Yufeng Resume
Li Yufeng ResumeLi Yufeng Resume
Li Yufeng Resume
Li Yufeng
 

Semelhante a Entity Framework 4 and WCF (20)

Entity Framework 4
Entity Framework 4Entity Framework 4
Entity Framework 4
 
Alfresco DevCon 2011. Implementing eGov Portal. Powered by Alfresco and Orbeon
Alfresco DevCon 2011. Implementing eGov Portal. Powered by Alfresco and OrbeonAlfresco DevCon 2011. Implementing eGov Portal. Powered by Alfresco and Orbeon
Alfresco DevCon 2011. Implementing eGov Portal. Powered by Alfresco and Orbeon
 
CASE-5 Using Alfresco and Orbeon to Implement a Local eGovernment Portal
CASE-5 Using Alfresco and Orbeon to Implement a Local eGovernment PortalCASE-5 Using Alfresco and Orbeon to Implement a Local eGovernment Portal
CASE-5 Using Alfresco and Orbeon to Implement a Local eGovernment Portal
 
ASP.NET MVC and Entity Framework 4
ASP.NET MVC and Entity Framework 4ASP.NET MVC and Entity Framework 4
ASP.NET MVC and Entity Framework 4
 
MVC and Entity Framework 4
MVC and Entity Framework 4MVC and Entity Framework 4
MVC and Entity Framework 4
 
Diving Into Entity Framework Code First
Diving Into Entity Framework Code FirstDiving Into Entity Framework Code First
Diving Into Entity Framework Code First
 
Entity Framework 4
Entity Framework 4Entity Framework 4
Entity Framework 4
 
Entity framework 4.0
Entity framework 4.0Entity framework 4.0
Entity framework 4.0
 
What's New in Entity Framework 4, by Julie Lerman
What's New in Entity Framework 4, by Julie LermanWhat's New in Entity Framework 4, by Julie Lerman
What's New in Entity Framework 4, by Julie Lerman
 
Pomeriggio Entity Framework - Database First
Pomeriggio Entity Framework - Database FirstPomeriggio Entity Framework - Database First
Pomeriggio Entity Framework - Database First
 
70487.pdf
70487.pdf70487.pdf
70487.pdf
 
DLF ILS Discovery Interface Task Force API recommendation
DLF ILS Discovery Interface Task Force API recommendationDLF ILS Discovery Interface Task Force API recommendation
DLF ILS Discovery Interface Task Force API recommendation
 
Real World API Design Using The Entity Framework Services
Real World API Design Using The Entity Framework ServicesReal World API Design Using The Entity Framework Services
Real World API Design Using The Entity Framework Services
 
.NET Core, ASP.NET Core Course, Session 16
.NET Core, ASP.NET Core Course, Session 16.NET Core, ASP.NET Core Course, Session 16
.NET Core, ASP.NET Core Course, Session 16
 
MVC and Entity Framework
MVC and Entity FrameworkMVC and Entity Framework
MVC and Entity Framework
 
Entity framework
Entity frameworkEntity framework
Entity framework
 
Cetas - Application Development Services
Cetas - Application Development ServicesCetas - Application Development Services
Cetas - Application Development Services
 
Entity Framework Today (May 2012)
Entity Framework Today (May 2012)Entity Framework Today (May 2012)
Entity Framework Today (May 2012)
 
MVC and Entity Framework 4
MVC and Entity Framework 4MVC and Entity Framework 4
MVC and Entity Framework 4
 
Li Yufeng Resume
Li Yufeng ResumeLi Yufeng Resume
Li Yufeng Resume
 

Mais de Julie Lerman

Julie Lerman: Entity Framework FTQs (Frequently Tweeted Questions)
Julie Lerman: Entity Framework FTQs (Frequently Tweeted Questions)Julie Lerman: Entity Framework FTQs (Frequently Tweeted Questions)
Julie Lerman: Entity Framework FTQs (Frequently Tweeted Questions)
Julie Lerman
 
Julie Lerman Entity Framework in the Enterprise (Boston Code Camp March 2013)
Julie Lerman Entity Framework in the Enterprise (Boston Code Camp March 2013)Julie Lerman Entity Framework in the Enterprise (Boston Code Camp March 2013)
Julie Lerman Entity Framework in the Enterprise (Boston Code Camp March 2013)
Julie Lerman
 
Working With Sql Azure from Entity Framework On-Premises (Julia Lerman)
Working With Sql Azure from Entity Framework On-Premises (Julia Lerman)Working With Sql Azure from Entity Framework On-Premises (Julia Lerman)
Working With Sql Azure from Entity Framework On-Premises (Julia Lerman)
Julie Lerman
 

Mais de Julie Lerman (18)

EF Core in Containerized ASP.NET Core APIs
EF Core in Containerized ASP.NET Core APIsEF Core in Containerized ASP.NET Core APIs
EF Core in Containerized ASP.NET Core APIs
 
Domain-Driven Design with Tender Loving Care (DDD with TLC)
Domain-Driven Design with Tender Loving Care (DDD with TLC)Domain-Driven Design with Tender Loving Care (DDD with TLC)
Domain-Driven Design with Tender Loving Care (DDD with TLC)
 
What's New in Visual Studio 2017
What's New in Visual Studio 2017What's New in Visual Studio 2017
What's New in Visual Studio 2017
 
A Tour of EF Core's (1.1) Most Interesting & Important Features
A Tour of EF Core's (1.1) Most Interesting & Important FeaturesA Tour of EF Core's (1.1) Most Interesting & Important Features
A Tour of EF Core's (1.1) Most Interesting & Important Features
 
EF6 or EF Core? How Do I Choose?
EF6 or EF Core? How Do I Choose?EF6 or EF Core? How Do I Choose?
EF6 or EF Core? How Do I Choose?
 
Microsoft for developers open source and cross platform
Microsoft for developers  open source and cross platformMicrosoft for developers  open source and cross platform
Microsoft for developers open source and cross platform
 
Entity Framework and Domain Driven Design
Entity Framework and Domain Driven DesignEntity Framework and Domain Driven Design
Entity Framework and Domain Driven Design
 
RavenDB Overview
RavenDB OverviewRavenDB Overview
RavenDB Overview
 
Julie Lerman: Entity Framework FTQs (Frequently Tweeted Questions)
Julie Lerman: Entity Framework FTQs (Frequently Tweeted Questions)Julie Lerman: Entity Framework FTQs (Frequently Tweeted Questions)
Julie Lerman: Entity Framework FTQs (Frequently Tweeted Questions)
 
Julie Lerman Entity Framework in the Enterprise (Boston Code Camp March 2013)
Julie Lerman Entity Framework in the Enterprise (Boston Code Camp March 2013)Julie Lerman Entity Framework in the Enterprise (Boston Code Camp March 2013)
Julie Lerman Entity Framework in the Enterprise (Boston Code Camp March 2013)
 
Working With Sql Azure from Entity Framework On-Premises (Julia Lerman)
Working With Sql Azure from Entity Framework On-Premises (Julia Lerman)Working With Sql Azure from Entity Framework On-Premises (Julia Lerman)
Working With Sql Azure from Entity Framework On-Premises (Julia Lerman)
 
Perspectives on Entity Framework, Julie Lerman
Perspectives on Entity Framework, Julie LermanPerspectives on Entity Framework, Julie Lerman
Perspectives on Entity Framework, Julie Lerman
 
Getting Persistence Ignorant with Entity Framework, Julie Lerman
Getting Persistence Ignorant with Entity Framework, Julie LermanGetting Persistence Ignorant with Entity Framework, Julie Lerman
Getting Persistence Ignorant with Entity Framework, Julie Lerman
 
AgileEntity Framework 4
AgileEntity Framework 4AgileEntity Framework 4
AgileEntity Framework 4
 
Lerman Adx303 Entity Framework 4 In Aspnet
Lerman Adx303 Entity Framework 4 In AspnetLerman Adx303 Entity Framework 4 In Aspnet
Lerman Adx303 Entity Framework 4 In Aspnet
 
Lerman Vvs14 Ef Tips And Tricks
Lerman Vvs14  Ef Tips And TricksLerman Vvs14  Ef Tips And Tricks
Lerman Vvs14 Ef Tips And Tricks
 
Using Entity Framework's New POCO Features: Part 1, by Julie Lerman
Using Entity Framework's New POCO Features: Part 1, by Julie LermanUsing Entity Framework's New POCO Features: Part 1, by Julie Lerman
Using Entity Framework's New POCO Features: Part 1, by Julie Lerman
 
Data in the Azure Cloud, by Julie Lerman
Data in the Azure Cloud, by Julie LermanData in the Azure Cloud, by Julie Lerman
Data in the Azure Cloud, by Julie Lerman
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

Entity Framework 4 and WCF

  • 1. Entity Framework 4 & WCF So Happy Together Julie Lerman www.thedatafarm.com jlerman@thedatafarm.com twitter @JulieLermanVT Julie Lerman: Entity Framework 4 and WCF [ESDC March 2010]
  • 2. Julie Lerman website theDataFarm.com blog & twitter theDataFarm.com/blog@julielermanVT book web site LearnEntityFramework.com consultant/mentor Microsoft MVP, INETA Speaker,ASPInsider, MCP, VTdotNET Leader Julie Lerman: Entity Framework 4 and WCF [ESDC March 2010] 2nd Edition Spring 2010
  • 3. Agenda New Features in EF that help with n-Tier POCO Support Foreign Keys State methods Serialization improvement Custom WCF Services Self-Tracking Entities Julie Lerman: Entity Framework 4 and WCF [ESDC March 2010]
  • 4. EFv1 and N-Tier EntityObjects are ugly when serialized Transferring to & from DTOs is painful No change-tracking in the objects Difficult & unsatisfying WCF patterns Julie Lerman: Entity Framework 4 and WCF [ESDC March 2010]
  • 5. ObjectContext Manages Entities Julie Lerman: Entity Framework 4 and WCF [ESDC March 2010] ObjectContext Person Object State info State info Order Object State info Detail Object State info Detail Object State info Order Object State info Detail Object State info Detail Object
  • 6. Hello POCO, Goodbye EntityObject Julie Lerman: Entity Framework 4 and WCF [ESDC March 2010]
  • 7. Code Gen POCOs from Model T4 More in Kathleen Dollard’s 2:30 talk, Wednesday: T4: Code Generation Microsoft Style Text Template Transformation Toolkit Julie Lerman: Entity Framework 4 and WCF [ESDC March 2010]
  • 8. New State Methods Support N-Tier Fix up newly attached entity’s EntityState ApplyCurrentValues ApplyOriginalValues ChangeState ChangeRelationshipState Used when there are no foreign keys Julie Lerman: Entity Framework 4 and WCF [ESDC March 2010]
  • 9.
  • 10.
  • 11. Foreign Key Support Default with new models Simplifies relationship management Huge benefits from WCF client to service Julie Lerman: Entity Framework 4 and WCF [ESDC March 2010]
  • 12. Basic Pattern for WCF in EF4 Use POCO entity classes No dynamic proxies (not virtual) Include a State property in the classes Return graphs Attach returned data to new context Fix up context state using POCO State If not using FKs Fix up relationships with help from DB data Julie Lerman: Entity Framework 4 and WCF [ESDC March 2010]
  • 13. Self-Tracking Entities (! very agile) For DataSet lovers Special T4 Code Gen Template Creates POCO Classes with state info Creates additional classes & interfaces “Magically: takes care of change tracking Used in client (.NET 4.0) & service For WCF/DataContract Serialization Julie Lerman: Entity Framework 4 and WCF [ESDC March 2010]
  • 14. Summary WCF was painful in EF version 1 Many improvements in EF4 to help n-Tier Writing custom WCF gets much easier Self-Tracking Entities are an out of the box solution to help DataSetdevs Don’t forget about WCF Data Services and WCF RIA Services as well Julie Lerman: Entity Framework 4 and WCF [ESDC March 2010]
  • 15. Julie Lerman website theDataFarm.com blog & twitter theDataFarm.com/blog@julielermanVT book web site LearnEntityFramework.com consultant/mentor Microsoft MVP, INETA Speaker,ASPInsider, MCP, VTdotNET Leader Julie Lerman: Entity Framework 4 and WCF [ESDC March 2010] 2nd Edition Spring 2010
  • 16. Resources Julie Lerman: Entity Framework 4 and WCF [ESDC March 2010]