Using Entity Framework's New POCO Features: Part 1, by Julie Lerman

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Using Entity Framework's New POCO Features: Part 1, by Julie Lerman - Presentation Transcript

    1. Using POCOS in Entity Framework 4Part 1
      Julie Lerman
      thedatafarm.com/blog
      jlerman@thedatafarm.com
      Julia Lerman October 17th 2009, New England Code Camp 12
    2. Note to Viewers
      This is Part 1 of a two part presentation. Part 2 covers testing and other patterns and how EF4 supports them. It was presented by Jamie Phillips. You can find his presentation at
      http://devblog.petrellyn.com/?p=189
      Julia Lerman October 17th 2009, New England Code Camp 12
    3. Julie Lerman
      Julia Lerman October 17th 2009, New England Code Camp 12
      website
      theDataFarm.com
      blog & twitter
      theDataFarm.com/blog@julielermanVT
      book web site
      LearnEntityFramework.com
      consultant/mentor
      Microsoft MVP, INETA Speaker,ASPInsider, MCP, VTdotNET Leader
    4. Agenda
      Standard EntityObject Classes
      Simple POCO Classes
      POCO and Proxies
      Generate POCO Classes with T4
      Code-Only Development
      Julia Lerman October 17th 2009, New England Code Camp 12
    5. EF1 & Default EF4 Gen’d Classes
      CustomTool=EntityModelCodeGenerator
      Julia Lerman October 17th 2009, New England Code Camp 12
    6. POCO: Plain Old CLR Object
      Define your classes
      Not bound to other APIs
      e.g. no inheritance from EntityObject
      Classes are reusable
      Simplifies testing
      and more…
      Julia Lerman October 17th 2009, New England Code Camp 12
    7. How Does EF4 Support POCO?
      EntityObjects interact with context
      For POCO, context does all of the work
      Classes don’t need to know about context
      Help provided by
      Special context methods
      Additional support via proxies
      Julia Lerman October 17th 2009, New England Code Camp 12
    8. Basic POCO Support
      Turn off code generation from EDMX
      “Convention” will auto-map classes/entities
      Julia Lerman October 17th 2009, New England Code Camp 12
    9. POCO and Other EF Features
      Complex Types: Supported
      Use a class (no structs) to represent the type
      Lazy Loading
      Declare property as virtual
      EF uses a proxy instance at runtime to load
      Explicit Loading
      ObjectContext.LoadProperty(myObj,”PropertyName”)
      ObjectCOntext.LoadProperty(myObj, o=>o.property)
      Julia Lerman October 17th 2009, New England Code Camp 12
    10. Change Tracking Options
      Snapshot
      Default change tracking
      Collected with DetectChanges is called
      Notification based
      virtual properties use Proxies
      Proxies can provide notification to context
      Julia Lerman October 17th 2009, New England Code Camp 12
    11. POCO Classes from Model
      Julia Lerman October 17th 2009, New England Code Camp 12
      T4
      Text Template Transformation Toolkit
    12. Code-Only Design
      Part of the Feature CTP
      No model at all
      Metadata is inferred from classes
      Convention by Default
      EF will rely 100% on presumptions
      Configuration Follows
      Tweak configurations to modify behavior
      Julia Lerman October 17th 2009, New England Code Camp 12
    13. Self-Tracking Entities
      Part of Feature CTP
      T4 Template to create specialized POCO classes
      EntityState is tracked by entity
      Specialized methods that know what to expect from the classes
      Julia Lerman October 17th 2009, New England Code Camp 12
    14. Resources
      LearnEntityFramework.com/resources
      blogs.msdn.com/adonet, efdesign, dsimmons, alexj, more...
      msdn.microsoft.com/data
      Gateway to whitepapers, forums, documentation
      Julia Lerman October 17th 2009, New England Code Camp 12
    15. Contact
      Julia Lerman October 17th 2009, New England Code Camp 12
      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 LermanJulie Lerman, 1 month ago

    custom

    356 views, 0 favs, 0 embeds more stats

    EF4, the new version of Entity Framework in .NET 4. more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 356
      • 356 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 0
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories