Download Database First - Microsoft Center

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Oracle Database wikipedia , lookup

Microsoft Access wikipedia , lookup

Extensible Storage Engine wikipedia , lookup

Microsoft SQL Server wikipedia , lookup

Entity–attribute–value model wikipedia , lookup

Open Database Connectivity wikipedia , lookup

Concurrency control wikipedia , lookup

Microsoft Jet Database Engine wikipedia , lookup

Database wikipedia , lookup

Versant Object Database wikipedia , lookup

Clusterpoint wikipedia , lookup

ContactPoint wikipedia , lookup

Relational model wikipedia , lookup

Database model wikipedia , lookup

Transcript
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
Object/Relational Mapper
Relational Database
{;}
{;}
Entity Framework Designer Models
{;}
{;}
{;}
Model / Classes
Conceptual Schema Definition Language (CSDL)
Mapping Specification Language (MSL)
Entity Framework
Relational Database
Store Schema Definition Language (SSDL)
EDMX
Entity Framework Architecture
{;}
{;}
Model / Classes
Object Services (DbContext)
Entity Client (ado.net / Entity SQL)
Entity Framework
Relational Database
Entity Framework Data Providers (SQL Server…)
{;}
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
Use Designer
Write Code
Model First:
Code 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
Create your classes in code
Mappings are defined in code
Database is generated from code
Updates are done using “migrations”
New Database
Database First:
Existing Database
•
•
•
•
•
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 Second: (not an official name)
•
•
•
Create your classes in code
Use Entity Framework Power Tools
Reverse engineer model in designer
Database First
Use Designer
Write Code
Model First:
Code 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
Create your classes in code
Mappings are defined in code
Database is generated from code
Updates are done using “migrations”
New Database
Database First:
Existing Database
•
•
•
•
•
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 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
Use Designer
Write Code
Model First:
Code 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
Create your classes in code
Mappings are defined in code
Database is generated from code
Updates are done using “migrations”
New Database
Database First:
Existing Database
•
•
•
•
•
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 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.