ADO.NET
E N T I T Y F R A M E W O R K
Clint Edmonson & Josh Gillespie
Polaris Solutions
Accretive Health Developer Days
AGENDA
• Introduction to EF 5
• Development Approaches
• Tips & Tricks
• What’s coming in EF 6
INTRODUCTION
• EntityFramework NuGet Package
• Included in Visual Studio 2012
• Works with Visual Studio 2010
• Works with .NET 4.0 and...
• EF designer and code first
• Enum support
• Spatial data types
• Performance improvements
• EF designer only
• Table-val...
New
Database
Existing
Database
Design First
Database First
Reverse engineer model in EF Designer
Classes auto-generated fr...
EF ARCHITECTURE
• Providers
• Context
• Set
• Entities
TIPS & TRICKS
ADVANCED TECHNIQUES
• Enums
• Complex Types
• Many to Many relationships
• Proxies & Lazy loading
TIPS & TRICKS
• Stored procedures and raw SQL calls
• EF Power Tools
• SQL statement profiling
• DbSet.AsNoTracking
• IQue...
OTHER CONSIDERATIONS…
• Transactions
• Unit testing
• Service boundaries
• Concurrency
• Entity mapping strategies
• Async query and save
• Dependency injection pattern
• Code first custom conventions
• Enums, spatial, etc. on .NET 4.0
•...
QUESTIONS?
THANK YOU!
Clint Edmonson
clint.edmonson@polarissolutions.com
Josh Gillespie
josh.gillespie@polarissolutions.com
APPENDIX
References
• http://msdn.microsoft.com/data/ef
• http://entityframework.codeplex.com/wikipage?title=specs
• http://visuals...
Upcoming SlideShare
Loading in...5
×

ADO.NET Entity Framework

654

Published on

Introduction to Microsoft's ADO.NET Entity Framework 5.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
654
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
27
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • ABCs of ORMsEntity Framework ArchitectureDB agnostic abstraction over DB-specific providersApproachesDesignerCode FirstShared Feature Tour/ComparisonEnumSpatial typesFunctions/SprocsLazy vs. eager loadingChange tracking/proxiesInheritance PatternsConcurrency PatternsWorkflowsModel FirstDB FirstCode First New DBCode First Old DBHow to Choose?Best Practices, Tips, TricksView Generation/warm-upConfiguration specificityUnit TestingRetry/Transient faultResist Lazy-LoadService Boundary considerationsoutputToolsEF Power ToolsMiniProfiler/GlimpseLINQPadComing up - Dev Roadmap (EF6)AsyncConnection ResiliencyDependency ResolutionInterception/SQL LoggingBetterTestabilityCustom ConventionsQ&A
  • Where are you today?How are you structured (are DBAs and Devs totally separate?)Ground rules (e.g. please stop us if you have questions)
  • ADO.NET Entity Framework

    1. 1. ADO.NET E N T I T Y F R A M E W O R K Clint Edmonson & Josh Gillespie Polaris Solutions Accretive Health Developer Days
    2. 2. AGENDA • Introduction to EF 5 • Development Approaches • Tips & Tricks • What’s coming in EF 6
    3. 3. INTRODUCTION
    4. 4. • EntityFramework NuGet Package • Included in Visual Studio 2012 • Works with Visual Studio 2010 • Works with .NET 4.0 and 4.5 • Most new features require .NET 4.5 ENTITY FRAMEWORK 5 (EF5)
    5. 5. • EF designer and code first • Enum support • Spatial data types • Performance improvements • EF designer only • Table-valued Functions (TVFs) • Multiple diagrams and coloring • DbContext code generation NEW IN EF5
    6. 6. New Database Existing Database Design First Database First Reverse engineer model in EF Designer Classes auto-generated from model Model First Create model in EF Designer Generate database from model Classes auto-generated from model DEVELOPER WORKFLOWS Code First Code First Define classes and mapping in code EF Power Tools provide reverse engineer Code First Define classes and mapping in code Database created from code Migrations apply model changes to database
    7. 7. EF ARCHITECTURE • Providers • Context • Set • Entities
    8. 8. TIPS & TRICKS
    9. 9. ADVANCED TECHNIQUES • Enums • Complex Types • Many to Many relationships • Proxies & Lazy loading
    10. 10. TIPS & TRICKS • Stored procedures and raw SQL calls • EF Power Tools • SQL statement profiling • DbSet.AsNoTracking • IQueryable.Load() • IQueryable.ToList() • DbSet.Local
    11. 11. OTHER CONSIDERATIONS… • Transactions • Unit testing • Service boundaries • Concurrency • Entity mapping strategies
    12. 12. • Async query and save • Dependency injection pattern • Code first custom conventions • Enums, spatial, etc. on .NET 4.0 • Connection resiliency (retry) • Tooling consolidation • Code first stored procedure support COMING IN EF6
    13. 13. QUESTIONS?
    14. 14. THANK YOU! Clint Edmonson clint.edmonson@polarissolutions.com Josh Gillespie josh.gillespie@polarissolutions.com
    15. 15. APPENDIX
    16. 16. References • http://msdn.microsoft.com/data/ef • http://entityframework.codeplex.com/wikipage?title=specs • http://visualstudiogallery.msdn.microsoft.com/72a60b14-1581- 4b9b-89f2-846072eff19d • http://msdn.microsoft.com/en-us/data/bb419139 • http://jkowalski.com/2010/04/23/logging-sql-statements-in- entity-frameworkcode-first/
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×