Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Entity Framework for Cross platform apps
1. EF For Cross Platform Apps
@svswaminathan
BDotNet UG Meet, Aug 2016
2. Swaminathan Vetri
• Senior Engineer @ Target
• Microsoft MVP - Visual Studio &
Development technologies
• Windows/Web/Cross platform mobile
developer
• Blogger, Speaker, Amateur photographer,
Gadget freak
2
3. Objective
• What is EF Core ?
• Why EF Core ?
• What it offers ?
• EF Core vs EF 6.x
• Demos
4. What is EF Core ?
• Entity Framework (EF) Core is an object-relational mapper (O/RM)
that enables .NET developers to work with a database using .NET
objects.
• EF Core is a lightweight and extensible version of the popular Entity
Framework data access technology.
5. Why EF Core ?
• Cross platform i.e., EF Core works on Windows/Mac/Linux
• Lightweight and Composable
• Supports new data stores (relational & non-relational)
• Multiple Database providers
• Optimized around being a simple intuitive O/RM
15. What’s new in EF Core ?
• Support for UWP, Asp.Net Core, Xamarin (coming soon)
• Database providers like InMemory, Azure Table storage, Redis etc.,
• Reverse engineer model from command line (Scaffold-DbContext)
• Shadow state properties
• Alternate Keys, Key generation at Client
• Mixed client/server evaluation
• Batching of statements (only relational)
16. What’s NOT available in EF Core ?
• Inheritance (Table per type, Table per concrete class)
• Many to many without join entities
• Complex/value types, Spatial data, graphical visualization of model,
Drag and drop editor, EDMX
• Reverse engineer from database (VS Wizard), Incremental model
update from DB
• Lazy loading, explicit loading, Stored Procedure
• Seed data, Connection resiliency, lifecycle hooks (events, command
interception etc.,)
LW & composable – built with CPU and memory in mind, built over composable blocks, pay-per-play, avoid unnecessary abstractions between top level API & DB
New data stores – Enables O/RM like features to be applied for non-relational ones, its NOT a replacement for noSQL SDK
Optimized for simple O/RM – not a micro O/RM, encourages a specific way of doing things, you can always go back to plain SQL when required
Shadow Properties : These do not exist in the model class, used purely for change tracking
Optimistic Concurrency – protects against overrides from other user’s changes
Transactions – to make sure changes are atomic
No tracking – for results that are read only ; doesn’t monitor the changes for the entities
DB creation/deletion APIs to quickly test DB without using migrations
Connection resiliency – automatically retries database commands on failure (more for sql azure kind of scenarios)