210 likes | 220 Views
Entity Framework 7 Who Are You & What Have You Done to my ORM ?. Julie Lerman theDataFarm.com @ julielerman. My Courses on. Getting Started with EF6 Domain-Driven Design Fundamentals Looking Ahead to Entity Framework 7 EF6 Ninja Edition: What’s New in EF6
E N D
Entity Framework 7Who Are You & What Have You Done to my ORM? Julie Lerman theDataFarm.com @julielerman
My Courses on Getting Started with EF6 Domain-Driven Design Fundamentals Looking Ahead to Entity Framework 7 EF6 Ninja Edition: What’s New in EF6 Automated Testing for Fraidy Cats Like Me Getting Started with Entity Framework 5 Entity Framework in the Enterprise Entity Framework Code First Migrations Data Layer Validation with Entity Framework 4.1+ Entity Framework 4.1 - DbContext Data Access Entity Framework 4.1 - Code First Querying the Entity Framework Designer Supported EDM Customization Entity Framework and Data Models Entity Framework 4.0 By Example
LET’S CODE
EF 1-6 so much technical debt!
EF7 A complete rewrite Familiar APIs Better APIs Not backwards compatible
“New Platforms, New Data Stores” Features We’ve Longed For ObjectContext EDMX
Windows 10 UAP & Full .NET Framework Core CLR/DNX Cross Plat DNX EF7 Won’t Require Full .NET Framework ASP.NET 5 Windows 8Phone & Store (not in 7.0.0)
Redis provider for EF7 Support for Relational providers System.Interactive.Async SQL Server provider for EF7 EF7 Core SQLiteProvider Azure Table Storage provider for EF7 In-Memory provider for EF7 System.Data. Common Support for Migrations Some NoSQL Provider Some Other NoSQL Provider Lean & Composable Just get what you need! Github Dev Branch
EF7 Progress & Releases EF7Future Release EF7 for ASP.NET5 v7.0.0 EF7 Goals LightWeight NewFeatures EF6 Parity Non- RDMS LightWeight (Most) NewFeatures (Some)EF6 Parity LightWeight NewFeatures EF6 Parity Non- RDMS EF6 remains default EntityFramework • EF6 Support Continues EF7 becomes default EntityFramework Features best for web apps
EF7.LaterWhen EF7 Becomes “The EF” • Complex Types (for Value Object support) • Explicit Loading • Richer Logging • Deeper change tracking API (e.g. Entry support for props, relationships) • Stored Procedure Mappings (for SaveChanges) • Connection Resiliency
Relational Databases SQL ServerSQLite for Device & Cross Platform Support SQL Compact (ErikEJ) Adding PostgreSQL (npgsql) Data Stores Non-Relational Providers NoSQL (proof of concept: Azure Table Storage) In-Memory (for integration testing w EF, not DB) Redis Cache (proof of concept) More . . .
WAT? ORM with NoSQL
FamiliarAPIs SaveChanges Change Tracking LINQ to Entities Migrations DbContext API Entity Model
Lighter Weight API Code Based Modeling Only Reverse engineer database still supported DbContext API Only Lower level functions from ObjectContext will be in DbContext Simpler Metadata API Losing some edge case mapping capabilities
Enable Long-Requested Features Shadow State forEntities DefaultDatabaseValues Type Conversions IOC Friendly In-Memory Provider for Fakes &Test Doubles Client & ServerQueryEvaluation Unique Constraints* Batch CUD More @ data.uservoice.com Enable Long-Requested Features
Some Changes Fluent Relationships HasMany, HasOne, WithMany, WithOne Replaced Has/With Many, Optional, Required Raw SQL FromSQL(xxxxxxxxxxxx) ComposableFromSQL(xxxxxxx).LinqMethod() Runtime Database Initialization EnsureCreated, EnsureDeleted No More DbInitializers
Help for Disconnected Graphs in EF7 Familiar APIs New Behavior New API
Post EF 7.0.0 Explicit Loading DbSet.Find Inheritance (see Roadmap! github.com/aspnet/EntityFramework/wiki/Roadmap)
Biggest Planned Feature Cuts EDMX Support ObjectContext API Entity SQL Metadata Workspace API Overly Complex Mappings MEST (Multiple Entities for Single Type) Mapping Automatic Migrations DbInitalization
Resources • github.com/aspnet/entityframework • github.com/aspnet/EntityFramework/wiki/Roadmap • My Pluralsight course on EF7: bit.ly/PS-EF7Alpha • January 2016 MSDN Mag Deep Dive into EF7 Migrations
Julie Lerman Email: julielerman@gmail.com Web: theDataFarm.com Twitter: @julielerman