• Save
Lerman Vvs13 Entity Framework 4 And Wcf
Upcoming SlideShare
Loading in...5
×
 

Lerman Vvs13 Entity Framework 4 And Wcf

on

  • 7,404 views

Julia Lerman

Julia Lerman
DevConnections Fall 2009 Session
Entity Framework 4 and WCF
www.learnentityframework.com

Statistics

Views

Total Views
7,404
Views on SlideShare
7,354
Embed Views
50

Actions

Likes
5
Downloads
0
Comments
1

1 Embed 50

http://www.slideshare.net 50

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • aa
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Lerman Vvs13 Entity Framework 4 And Wcf Lerman Vvs13 Entity Framework 4 And Wcf Presentation Transcript

  • VVS13:WCF + Entity Frameworkin Visual Studio 2010
    Julie Lerman
    www.thedatafarm.com
    jlerman@thedatafarm.com
    twitter @JulieLermanVT
  • 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
  • Agenda
    New Features in EF that help with n-tier
    POCO Support
    Foreign Keys
    State methods
    Serialization improvement
    Custom WCF Services
    Self-Tracking Entities
  • 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
  • Basic POCO Support in EF4
    Turn off code generation from EDMX
    “Convention” will auto-map classes/entities
  • Additional POCO Features
    Change Tracking
    By Snapshot or Proxy
    Lazy Loading
    By Proxy
    Code Only Design
    No Physical Model
    Convention and Configuration
  • Simpler Code Gen Customization
    T4
    Text Template Transformation Toolkit
  • New State Methods Support N-Tier
    ApplyCurrentValues
    ApplyOriginalValues
    ChangeState
    ChangeRelationshipState
    Used when there are no foreign keys
  • Change State w ApplyCurrentValues
    Client Requests
    Object
    Service queries db/cache &returns object
    fName: Julie
    lName: Lerman
    Client User Edits Object & returns to service
    fName: Julie
    lName: Flynn
    Service queries db/cache for original object
    fName: Julie
    fName: Julie
    lName: Lerman
    Service updates original object with values from client
    lName: Flynn
    SaveChanges
    ApplyCurrentValues
  • Foreign Key Support
    Arrived in Beta 2
    Default with new models
    Simplifies relationship management
  • Basic Pattern for WCF in EF4
    Use POCO entity classes
    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
  • Self-Tracking Entities
    Special API in Feature CTP
    POCO Classes with state information
    Special method to apply changes to an entire graph
    Magically takes care of change tracking
    Written for WCF and DataContract Serialization
    Does not apply to ASP.NET, etc.
  • 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 a good out of the box solution
    Don’t forget about ADO.NET Data Services and RIA Services as well
  • 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
  • Resources
    EF Team Blogs (blogs.msdn.com/)
    adonet, efdesign, dsimmons, adjames, more..
    Rowan Miller (romiller.com) (EF Team)
    WCF EF POCO demo with unit tests
    Danny Simmons’ Aug 2009 MSDN Mag
    MS PAG: Data Access Guidance
    dataguidance.codeplex.com