SlideShare a Scribd company logo
05 | Data Access with Entity Framework 
Bruno Terkaly | Technical Evangelist 
Bret Stateham | Technical Evangelist
Module Overview 
• Entity Data Models 
• Developer Workflows 
• WCF Data Services
Entity Data Models
Object/Relational Mappers (ORMs) 
Model / Classes 
Relational Database 
{;} {;} {;} 
Object/Relational Mapper
Entity Framework Designer Models 
Model / Classes 
Entity Framework 
Conceptual Schema Definition Language (CSDL) 
Mapping Specification Language (MSL) 
Store Schema Definition Language (SSDL) 
EDMX 
Relational Database 
{;} {;} {;}
Entity Framework Architecture 
Model / Classes 
Entity Framework 
Object Services (DbContext) 
Entity Client (ado.net / Entity SQL) 
Entity Framework Data Providers (SQL Server…) 
Relational Database 
{;} {;} {;}
Get it With NuGet. Got It? 
• Entity Framework 6 is RTM 
• EntityFramework.codeplex.com 
– Open Source 
– Nightly Builds 
– Accept pull requests from the community 
• Installable from NuGet 
– Release versions 
– Pre-Release if you choose to include them
Entity Framework Data Providers 
• Microsoft Ships support for 
– Microsoft SQL Server 
(Via the EntityFramework NuGet Package) 
– Microsoft SQL Server Compact Edition 
(Via the EntityFramework.SqlServerCompact NuGet Package) 
• 3rd Party Providers 
– DevArt dotConnect Data Providers (devart.com) 
• Oracle 
• MySQL 
• SQLite 
• others 
– Firebird (FirebirdSQL.org)
Developer Workflows
Entity Framework Workflows 
New Database 
Existing Database 
Use Designer Write Code 
Model First: 
• Create your model in the designer 
• Database is generated from model 
• Classes are generated from model 
• Can update model 
• Database updates replace old objects 
Database First: 
• Reverse engineer existing database 
• Designer generates model 
• Classes are generated off the model 
• You can update the database 
• You can modify the classes / mapping 
Code First: 
• Create your classes in code 
• Mappings are defined in code 
• Database is generated from code 
• Updates are done using “migrations” 
Code Second: (not an official name) 
• Create your classes in code 
• Use Entity Framework Power Tools 
• Reverse engineer model in designer
Database First 
New Database 
Existing Database 
Use Designer Write Code 
Model First: 
• Create your model in the designer 
• Database is generated from model 
• Classes are generated from model 
• Can update model 
• Database updates replace old objects 
Database First: 
• Reverse engineer existing database 
• Designer generates model 
• Classes are generated off the model 
• You can update the database 
• You can modify the classes / mapping 
Code First: 
• Create your classes in code 
• Mappings are defined in code 
• Database is generated from code 
• Updates are done using “migrations” 
Code Second: (not an official name) 
• Create your classes in code 
• Use Entity Framework Power Tools 
• Reverse engineer model in designer
DEMO 
Database First Workflow
Code First Workflow 
New Database 
Existing Database 
Use Designer Write Code 
Model First: 
• Create your model in the designer 
• Database is generated from model 
• Classes are generated from model 
• Can update model 
• Database updates replace old objects 
Database First: 
• Reverse engineer existing database 
• Designer generates model 
• Classes are generated off the model 
• You can update the database 
• You can modify the classes / mapping 
Code First: 
• Create your classes in code 
• Mappings are defined in code 
• Database is generated from code 
• Updates are done using “migrations” 
Code Second: (not an official name) 
• Create your classes in code 
• Use Entity Framework Power Tools 
• Reverse engineer model in designer
DEMO 
Code First Workflow
WCF Data Services
OData Where Art Though? 
• OData is a protocol for creating and consuming data APIs 
• Check it out at OData.org 
• Provides a standard way to use REST to expose & consume data
WCF Data Services 
• A convenient way to create OData services 
• Can expose most any model as Odata 
• Entity Framework is a great way to build your models 
• WCF Data Services 5.6.0 Available via NuGet 
– WCF Data Services Server – Microsoft.Data.Services 
– WCF Data Services Client – Microsoft.Data.Services.Client 
• Access Data using URIs or a Client Library 
– OData Query String Options
DEMO 
Creating and Consuming a WCF Data Service
©2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Office, Azure, System Center, Dynamics and other product names are or may be registered trademarks and/or trademarks in 
the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because 
Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information 
provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

More Related Content

PDF
Learn Entity Framework in a day with Code First, Model First and Database First
PPTX
Entity framework code first
PPTX
Microsoft Entity Framework
PPTX
Introducing Entity Framework 4.0
PPTX
Entity Framework Database and Code First
PPT
Entity framework 4.0
PPTX
Entity framework core v3 from sql to no sql
PPTX
13 - Panorama Necto 14 building models - visualization & data discovery solu...
Learn Entity Framework in a day with Code First, Model First and Database First
Entity framework code first
Microsoft Entity Framework
Introducing Entity Framework 4.0
Entity Framework Database and Code First
Entity framework 4.0
Entity framework core v3 from sql to no sql
13 - Panorama Necto 14 building models - visualization & data discovery solu...

What's hot (20)

KEY
Introducing the Entity Framework
PPTX
Survey of the Microsoft Azure Data Landscape
PPTX
U-SQL Learning Resources (SQLBits 2016)
PPTX
Providers
PPTX
Entity framework introduction sesion-1
PDF
Sebastian Cohnen – Building a Startup with NoSQL - NoSQL matters Barcelona 2014
PDF
NoSQL Now! Webinar Series: Innovations in NoSQL Query Languages
PDF
JIRA Development
PPTX
SQL vs. NoSQL. It's always a hard choice.
PPTX
iForum 2015: SQL vs. NoSQL
PPTX
Tips & Tricks SQL in the City Seattle 2014
PPTX
Entity Framework 4
PPTX
Entity Framework Core 2.1: Simple, Powerful Data Access for .NET
PPTX
.Net Fundamentals
PPTX
Introduction to Azure DocumentDB
PPTX
Slick - The Structured Way
PPTX
SQL vs NoSQL
PPTX
Introduction to RavenDB
PPTX
Entity Framework Overview
Introducing the Entity Framework
Survey of the Microsoft Azure Data Landscape
U-SQL Learning Resources (SQLBits 2016)
Providers
Entity framework introduction sesion-1
Sebastian Cohnen – Building a Startup with NoSQL - NoSQL matters Barcelona 2014
NoSQL Now! Webinar Series: Innovations in NoSQL Query Languages
JIRA Development
SQL vs. NoSQL. It's always a hard choice.
iForum 2015: SQL vs. NoSQL
Tips & Tricks SQL in the City Seattle 2014
Entity Framework 4
Entity Framework Core 2.1: Simple, Powerful Data Access for .NET
.Net Fundamentals
Introduction to Azure DocumentDB
Slick - The Structured Way
SQL vs NoSQL
Introduction to RavenDB
Entity Framework Overview
Ad

Viewers also liked (6)

PPTX
Introduction to C#
PPT
Control structures selection
PPT
C++ programming program design including data structures
PPTX
Electrical circuit
PPTX
Selection Statements in C Programming
PPSX
Microsoft C# programming basics
Introduction to C#
Control structures selection
C++ programming program design including data structures
Electrical circuit
Selection Statements in C Programming
Microsoft C# programming basics
Ad

Similar to 05 entity framework (20)

PDF
70487.pdf
PPTX
Building N Tier Applications With Entity Framework Services 2010
PPTX
Entity Framework V1 and V2
PDF
Entity Framework 6 Recipes 2nd Edition Brian Driscoll
PPTX
Applying EF Code First at Your Job
PPTX
Entity Framework v1 and v2
PDF
Entity Framework 6 Recipes 2nd Edition Brian Driscoll
PPT
What's New for Data?
PPTX
Building nTier Applications with Entity Framework Services (Part 2)
PDF
Entity Framework 6 Recipes 2nd Edition Brian Driscoll
PPTX
PPTX
Entity Framework Today (May 2012)
PPTX
dotNet Miami - June 21, 2012: Richie Rump: Entity Framework: Code First and M...
PDF
Entity Framework 6 Recipes 2nd Edition Brian Driscoll
PPTX
Entity Framework: Code First and Magic Unicorns
PPT
ADO.NET Entity Framework
PPT
Entity Framework Overview
PPTX
Entity framework
PPTX
Entity Framework Overview
PDF
Entity Framework Interview Questions PDF By ScholarHat
70487.pdf
Building N Tier Applications With Entity Framework Services 2010
Entity Framework V1 and V2
Entity Framework 6 Recipes 2nd Edition Brian Driscoll
Applying EF Code First at Your Job
Entity Framework v1 and v2
Entity Framework 6 Recipes 2nd Edition Brian Driscoll
What's New for Data?
Building nTier Applications with Entity Framework Services (Part 2)
Entity Framework 6 Recipes 2nd Edition Brian Driscoll
Entity Framework Today (May 2012)
dotNet Miami - June 21, 2012: Richie Rump: Entity Framework: Code First and M...
Entity Framework 6 Recipes 2nd Edition Brian Driscoll
Entity Framework: Code First and Magic Unicorns
ADO.NET Entity Framework
Entity Framework Overview
Entity framework
Entity Framework Overview
Entity Framework Interview Questions PDF By ScholarHat

More from Bat Programmer (7)

PPTX
07 advanced topics
PPTX
06 web api
PPTX
04 data accesstechnologies
PPTX
03 data storage
PPTX
02 hosting servicesinwindowsazure
PPTX
1. WCF Services - Exam 70-487
DOCX
Guide to MCPD - Web Developer 4
07 advanced topics
06 web api
04 data accesstechnologies
03 data storage
02 hosting servicesinwindowsazure
1. WCF Services - Exam 70-487
Guide to MCPD - Web Developer 4

05 entity framework

  • 1. 05 | Data Access with Entity Framework Bruno Terkaly | Technical Evangelist Bret Stateham | Technical Evangelist
  • 2. Module Overview • Entity Data Models • Developer Workflows • WCF Data Services
  • 4. Object/Relational Mappers (ORMs) Model / Classes Relational Database {;} {;} {;} Object/Relational Mapper
  • 5. Entity Framework Designer Models Model / Classes Entity Framework Conceptual Schema Definition Language (CSDL) Mapping Specification Language (MSL) Store Schema Definition Language (SSDL) EDMX Relational Database {;} {;} {;}
  • 6. Entity Framework Architecture Model / Classes Entity Framework Object Services (DbContext) Entity Client (ado.net / Entity SQL) Entity Framework Data Providers (SQL Server…) Relational Database {;} {;} {;}
  • 7. Get it With NuGet. Got It? • Entity Framework 6 is RTM • EntityFramework.codeplex.com – Open Source – Nightly Builds – Accept pull requests from the community • Installable from NuGet – Release versions – Pre-Release if you choose to include them
  • 8. Entity Framework Data Providers • Microsoft Ships support for – Microsoft SQL Server (Via the EntityFramework NuGet Package) – Microsoft SQL Server Compact Edition (Via the EntityFramework.SqlServerCompact NuGet Package) • 3rd Party Providers – DevArt dotConnect Data Providers (devart.com) • Oracle • MySQL • SQLite • others – Firebird (FirebirdSQL.org)
  • 10. Entity Framework Workflows New Database Existing Database Use Designer Write Code Model First: • Create your model in the designer • Database is generated from model • Classes are generated from model • Can update model • Database updates replace old objects Database First: • Reverse engineer existing database • Designer generates model • Classes are generated off the model • You can update the database • You can modify the classes / mapping Code First: • Create your classes in code • Mappings are defined in code • Database is generated from code • Updates are done using “migrations” Code Second: (not an official name) • Create your classes in code • Use Entity Framework Power Tools • Reverse engineer model in designer
  • 11. Database First New Database Existing Database Use Designer Write Code Model First: • Create your model in the designer • Database is generated from model • Classes are generated from model • Can update model • Database updates replace old objects Database First: • Reverse engineer existing database • Designer generates model • Classes are generated off the model • You can update the database • You can modify the classes / mapping Code First: • Create your classes in code • Mappings are defined in code • Database is generated from code • Updates are done using “migrations” Code Second: (not an official name) • Create your classes in code • Use Entity Framework Power Tools • Reverse engineer model in designer
  • 13. Code First Workflow New Database Existing Database Use Designer Write Code Model First: • Create your model in the designer • Database is generated from model • Classes are generated from model • Can update model • Database updates replace old objects Database First: • Reverse engineer existing database • Designer generates model • Classes are generated off the model • You can update the database • You can modify the classes / mapping Code First: • Create your classes in code • Mappings are defined in code • Database is generated from code • Updates are done using “migrations” Code Second: (not an official name) • Create your classes in code • Use Entity Framework Power Tools • Reverse engineer model in designer
  • 14. DEMO Code First Workflow
  • 16. OData Where Art Though? • OData is a protocol for creating and consuming data APIs • Check it out at OData.org • Provides a standard way to use REST to expose & consume data
  • 17. WCF Data Services • A convenient way to create OData services • Can expose most any model as Odata • Entity Framework is a great way to build your models • WCF Data Services 5.6.0 Available via NuGet – WCF Data Services Server – Microsoft.Data.Services – WCF Data Services Client – Microsoft.Data.Services.Client • Access Data using URIs or a Client Library – OData Query String Options
  • 18. DEMO Creating and Consuming a WCF Data Service
  • 19. ©2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Office, Azure, System Center, Dynamics and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Editor's Notes