Upgrade to Pro — share decks privately, control downloads, hide ads and more …

4DotNet: Sessie Entity Framework Core - Patrick...

4Dotnet
June 29, 2017
74

4DotNet: Sessie Entity Framework Core - Patrick Schmidt

Op het 4DotNet Event 'Continuous Delivery & Entity Framework Core' van 29 juni 2017 heeft Patrick Schmidt een sessie verzorgd over Entity Framework Core.

4Dotnet

June 29, 2017
Tweet

Transcript

  1. What is it? • Lightweight ORM for .NET • Platform

    independent (from EFCore on) www.4dotnet.nl
  2. Version History • EF 1. 2008 with SP1 of VS2008

    • EF 4. 2010 (Framework 4.0) • EF 5. 2012 (Framework 4.5) • EF 6. 2013 Became an open source project • EF Core 1 (2016) Used to be called EF 7 • EF Core 2 (Expected Q3 2017) www.4dotnet.nl
  3. EF 6.1.3 vs EF Core 1.1 vs EF Core 2

    preview Feature EF 6.1.3 EF Core 1.1 EF Core 2.0 preview 1 Complex Types Yes No Partial/Owned Entities Model Visualizer Yes No No Spatial data Yes No No Many-to-Many relations Yes No No Shadow State Properties No Yes Yes Fluent Api Yes Yes Yes SP Mapping Yes No No TPH/TPT/TPC Yes/Yes/Yes Yes/No/No Yes/No/No Modelling
  4. EF 6.1.3 vs EF Core 1.1 vs EF Core 2

    preview Feature EF 6.1.3 EF Core 1.1 EF Core 2.0 preview 1 Simple Queries OK OK OK Moderate Queries OK OK OK Complex Queries OK Mwah ? Eager Loading Yes Yes Yes Lazy Loading Yes No No Global Filters No No Yes Compiled Queries Yes No Yes EF Function No No Yes Raw Queries with LINQ No Yes Yes Query Data
  5. EF 6.1.3 vs EF Core 1.1 vs EF Core 2

    preview Feature EF 6.1.3 EF Core 1.1 EF Core 2.0 preview 1 Stored Procedure Yes No No Optimistic Concurrency Yes Yes Yes Transactions Yes Yes Yes Batch/Bulk updates No Yes Yes Saving Data
  6. EF 6.1.3 vs EF Core 1.1 vs EF Core 2

    preview Feature EF 6.1.3 EF Core 1.1 EF Core 2.0 preview 1 Migrations Yes Yes Yes Database create/delete Yes Yes Yes Seed data Yes No Yes Connection Resiliency Yes Yes Yes Context Pooling No No Yes Other features
  7. Lazy Loading and Many-to-many • Lazy loading is not supported

    yet • Still discussing it and it seems it’s going to be supported some time • Use eager loading instead • Include • ThenInclude • Many-to-Many is not supported without extra entity • Not sure when it will be added. Probably when Lazy Loading is supported www.4dotnet.nl
  8. Flexible Mapping (v1.1) • Possibility to map private fields to

    database field • Works via a conceptual property www.4dotnet.nl
  9. Batching (v1.1) • Previously multiple modifications were wrapped in a

    transaction and sent to de database one after each other • Finally batching is supported www.4dotnet.nl
  10. Owned Entities and Table Splitting (v2.0) • Complex Properties are

    mapped on a separate table. • In future Complex Properties can be mapped to fields of same table • Use OwnesOne() www.4dotnet.nl
  11. Context Pooling (v2.0) • The ability to pool complete DbContexts

    • Performance improvement • Through DI • AddDbContextPool() • State will be reset after Context has been finalized www.4dotnet.nl
  12. Functions (V2.0) • Allows Database Providers to map database function

    that can be incorporated in LINQ • So far only ‘Like’ is supported • Others will appear soon • Risk of incorporate database dialects in LINQ www.4dotnet.nl