• Save
The Entity Data Model
Upcoming SlideShare
Loading in...5
×
 

The Entity Data Model

on

  • 615 views

Learn how to create and use an Entity Data Model, explore the raw XML behind the model as a way to understand how Entity Framework works, and see how to use stored procedures within an Entity ...

Learn how to create and use an Entity Data Model, explore the raw XML behind the model as a way to understand how Entity Framework works, and see how to use stored procedures within an Entity Framework model.

Statistics

Views

Total Views
615
Views on SlideShare
609
Embed Views
6

Actions

Likes
0
Downloads
0
Comments
0

1 Embed 6

http://www.mefeedia.com 6

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • DEMO: Try It Out!\n
  • DEMO: Try It Out!\n
  • DEMO: Try It Out!\n
  • DEMO: Try It Out!\n
  • DEMO: Try It Out!\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • DEMO: Rest of section\n
  • DEMO: Rest of section\n
  • DEMO: Rest of section\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • DEMO: Rest of Try It Now!\n
  • DEMO: Rest of Try It Now!\n
  • DEMO: Rest of Try It Now!\n
  • DEMO: Rest of Try It Now!\n
  • DEMO: Rest of Try It Now!\n
  • DEMO: Rest of Try It Now!\n
  • DEMO: Rest of Try It Now!\n
  • DEMO: Rest of Try It Now!\n
  • DEMO: Rest of Try It Now!\n
  • DEMO: Rest of Try It Now!\n
  • DEMO: Rest of Try It Now!\n
  • DEMO: Rest of Try It Now!\n
  • DEMO: Rest of Try It Now!\n
  • DEMO: Rest of section\n
  • DEMO: Rest of section\n
  • DEMO: Rest of section\n
  • DEMO: Rest of section\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • DEMO: rest of section, Designer Section, Runtime Section, Conceptual Model XML, Storage Model XML, Mapping Model XML sections\n
  • DEMO: rest of section, Designer Section, Runtime Section, Conceptual Model XML, Storage Model XML, Mapping Model XML sections\n
  • DEMO: rest of section, Designer Section, Runtime Section, Conceptual Model XML, Storage Model XML, Mapping Model XML sections\n
  • DEMO: rest of section, Designer Section, Runtime Section, Conceptual Model XML, Storage Model XML, Mapping Model XML sections\n
  • DEMO: rest of section, Designer Section, Runtime Section, Conceptual Model XML, Storage Model XML, Mapping Model XML sections\n
  • DEMO: rest of section\n
  • DEMO: rest of section\n
  • DEMO: rest of section\n
  • DEMO: rest of section\n
  • DEMO: rest of section\n
  • DEMO: rest of section\n
  • DEMO: rest of section\n
  • DEMO: rest of section\n
  • DEMO: rest of section\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • DEMO: Try It Out!\n
  • DEMO: Try It Out!\n
  • DEMO: Try It Out!\n
  • DEMO: Try It Out!\n
  • DEMO: Try It Out!\n
  • DEMO: Try It Out!\n
  • DEMO: Try It Out!\n
  • DEMO: Try It Out!\n
  • DEMO: Try It Out!\n
  • DEMO: Try It Out!\n
  • DEMO: Try It Out!\n
  • DEMO: Try It Out!\n
  • DEMO: Try It Out!\n
  • DEMO: Try It Out!\n
  • DEMO: Try It Out!\n
  • DEMO: Try It Out!\n
  • DEMO: Try It Out!\n
  • DEMO: Try It Out!\n
  • DEMO: Try It Out!\n
  • DEMO: Try It Out!\n
  • DEMO: Try It Out!\n
  • DEMO: Try It Out!\n
  • DEMO: Try It Out!\n
  • DEMO: rest of section\n
  • DEMO: rest of section\n
  • DEMO: rest of section\n
  • DEMO: rest of section\n

The Entity Data Model The Entity Data Model Presentation Transcript

  • The Entity Data Model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Objectives Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Objectives• Learn how to create and use an Entity Data Model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Objectives• Learn how to create and use an Entity Data Model• Explore the raw XML behind the model as a way to understand how Entity Framework works Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Objectives• Learn how to create and use an Entity Data Model• Explore the raw XML behind the model as a way to understand how Entity Framework works• See how to use stored procedures within an Entity Framework model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Agenda Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Agenda• Introduction Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Agenda• Introduction• Creating and Using an Entity Data Model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Agenda• Introduction• Creating and Using an Entity Data Model• Entity Data Model in the Raw Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Agenda• Introduction• Creating and Using an Entity Data Model• Entity Data Model in the Raw• Using Stored Procedures in the Model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Introduction Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Introduction• Key link between entity objects and data Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Introduction• Key link between entity objects and data  Conceptual model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Introduction• Key link between entity objects and data  Conceptual model  Storage model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Introduction• Key link between entity objects and data  Conceptual model  Storage model  Mapping model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Introduction• Key link between entity objects and data  Conceptual model  Storage model  Mapping model• Application design is often at odds with database design Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Introduction• Key link between entity objects and data  Conceptual model  Storage model  Mapping model• Application design is often at odds with database design• Can work with model in designer Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Introduction• Key link between entity objects and data  Conceptual model  Storage model  Mapping model• Application design is often at odds with database design• Can work with model in designer  Or get messy with the XML Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Introduction• Key link between entity objects and data  Conceptual model  Storage model  Mapping model• Application design is often at odds with database design• Can work with model in designer  Or get messy with the XML• At build, split into three XML files Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Introduction• Key link between entity objects and data  Conceptual model  Storage model  Mapping model• Application design is often at odds with database design• Can work with model in designer  Or get messy with the XML• At build, split into three XML files• Developers don’t have to know the database Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • The Models within the Model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • The Models within the Model• Conceptual Model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • The Models within the Model• Conceptual Model  The actual Entity Data Model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • The Models within the Model• Conceptual Model  The actual Entity Data Model  Provides what is needed to create data objects Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • The Models within the Model• Conceptual Model  The actual Entity Data Model  Provides what is needed to create data objects• Storage Model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • The Models within the Model• Conceptual Model  The actual Entity Data Model  Provides what is needed to create data objects• Storage Model  Represents the database schemas Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • The Models within the Model• Conceptual Model  The actual Entity Data Model  Provides what is needed to create data objects• Storage Model  Represents the database schemas  Can be similar to conceptual model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • The Models within the Model• Conceptual Model  The actual Entity Data Model  Provides what is needed to create data objects• Storage Model  Represents the database schemas  Can be similar to conceptual model  Decupling of conceptual design from the database Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • The Models within the Model• Conceptual Model  The actual Entity Data Model  Provides what is needed to create data objects• Storage Model  Represents the database schemas  Can be similar to conceptual model  Decupling of conceptual design from the database• Mapping Model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • The Models within the Model• Conceptual Model  The actual Entity Data Model  Provides what is needed to create data objects• Storage Model  Represents the database schemas  Can be similar to conceptual model  Decupling of conceptual design from the database• Mapping Model  Bridge between conceptual and storage models Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • The Models within the Model• Conceptual Model  The actual Entity Data Model  Provides what is needed to create data objects• Storage Model  Represents the database schemas  Can be similar to conceptual model  Decupling of conceptual design from the database• Mapping Model  Bridge between conceptual and storage models  Map object properties to database fields Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Agenda Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Agenda• Introduction Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Agenda• Introduction• Creating and Using an Entity Data Model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Agenda• Introduction• Creating and Using an Entity Data Model• Entity Data Model in the Raw Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Agenda• Introduction• Creating and Using an Entity Data Model• Entity Data Model in the Raw• Using Stored Procedures in the Model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Creating and Using an Entity DataModel Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Creating and Using an Entity DataModel• Can create from scratch using XML Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Creating and Using an Entity DataModel• Can create from scratch using XML  More productive using the designer Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Creating and Using an Entity DataModel• Can create from scratch using XML  More productive using the designer• Three approaches Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Creating and Using an Entity DataModel• Can create from scratch using XML  More productive using the designer• Three approaches  Database-first Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Creating and Using an Entity DataModel• Can create from scratch using XML  More productive using the designer• Three approaches  Database-first  Model-first Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Creating and Using an Entity DataModel• Can create from scratch using XML  More productive using the designer• Three approaches  Database-first  Model-first  Code-first Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Creating a Model Using Database-First Design Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Creating a Model Using Database-First Design• Directly supported by the Entity Framework template Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Creating a Model Using Database-First Design• Directly supported by the Entity Framework template• Wizard lets you Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Creating a Model Using Database-First Design• Directly supported by the Entity Framework template• Wizard lets you  Reverse-engineer the database schma Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Creating a Model Using Database-First Design• Directly supported by the Entity Framework template• Wizard lets you  Reverse-engineer the database schma  Select tables, views, and stored procedures to include Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Creating a Model Using Database-First Design• Directly supported by the Entity Framework template• Wizard lets you  Reverse-engineer the database schma  Select tables, views, and stored procedures to include  Build the model from selected objects Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Multiplicity Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Multiplicity• Used with associations Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Multiplicity• Used with associations• Number of entities that can be on each end of an association Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Multiplicity• Used with associations• Number of entities that can be on each end of an association  Sometimes referred to as cardinality Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Multiplicity• Used with associations• Number of entities that can be on each end of an association  Sometimes referred to as cardinality• Three options Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Multiplicity• Used with associations• Number of entities that can be on each end of an association  Sometimes referred to as cardinality• Three options  One: 1 Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Multiplicity• Used with associations• Number of entities that can be on each end of an association  Sometimes referred to as cardinality• Three options  One: 1  Zero or one: 0..1 Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Multiplicity• Used with associations• Number of entities that can be on each end of an association  Sometimes referred to as cardinality• Three options  One: 1  Zero or one: 0..1  Many: * Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Multiplicity• Used with associations• Number of entities that can be on each end of an association  Sometimes referred to as cardinality• Three options  One: 1  Zero or one: 0..1  Many: *• Can combine in various ways, such as Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Multiplicity• Used with associations• Number of entities that can be on each end of an association  Sometimes referred to as cardinality• Three options  One: 1  Zero or one: 0..1  Many: *• Can combine in various ways, such as  1:* Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Multiplicity• Used with associations• Number of entities that can be on each end of an association  Sometimes referred to as cardinality• Three options  One: 1  Zero or one: 0..1  Many: *• Can combine in various ways, such as  1:*  0..1:* Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Multiplicity• Used with associations• Number of entities that can be on each end of an association  Sometimes referred to as cardinality• Three options  One: 1  Zero or one: 0..1  Many: *• Can combine in various ways, such as  1:*  0..1:*  *:* Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Entity Data Model Object Properties Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Entity Data Model Object Properties• Typical for Visual Studio Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Entity Data Model Object Properties• Typical for Visual Studio• Use Properties windows to set values of properties for various objects Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Entity Data Model Object Properties• Typical for Visual Studio• Use Properties windows to set values of properties for various objects• Model stores some in model’s XML to define a model, others guide object creation Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Creating a Model UsingModel-First Design Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Creating a Model UsingModel-First Design• Database-first design is common Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Creating a Model UsingModel-First Design• Database-first design is common• Sometimes creating a new database with the application Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Creating a Model UsingModel-First Design• Database-first design is common• Sometimes creating a new database with the application  Could create the database first Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Creating a Model UsingModel-First Design• Database-first design is common• Sometimes creating a new database with the application  Could create the database first  But model-first is another option Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Creating a Model UsingModel-First Design• Database-first design is common• Sometimes creating a new database with the application  Could create the database first  But model-first is another option  Strictly speaking, Entity Framework has always had this option Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Creating a Model UsingModel-First Design• Database-first design is common• Sometimes creating a new database with the application  Could create the database first  But model-first is another option  Strictly speaking, Entity Framework has always had this option• Generate Database from Model option Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Creating a Model UsingModel-First Design• Database-first design is common• Sometimes creating a new database with the application  Could create the database first  But model-first is another option  Strictly speaking, Entity Framework has always had this option• Generate Database from Model option• Entity Designer Database Generation Power Pack Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Sled Dog Event Registration Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Sled Dog Event Registration Team Event Race FirstName Name 1 * 1 * Distance LastName EventDate DogCount City Sponsor Trail Country Location DogCount Mushing Skijoring Leader1 Dog1 Leader2 Dog2 Dog3 NumberOfLeaders Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Explore the Model with theModel Browser Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Explore the Model with theModel Browser• Working with large models can be hard in the designer Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Explore the Model with theModel Browser• Working with large models can be hard in the designer  Can be hard to understand the structure of the model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Explore the Model with theModel Browser• Working with large models can be hard in the designer  Can be hard to understand the structure of the model  Mapping Details windows doesn’t have details of storage model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Explore the Model with theModel Browser• Working with large models can be hard in the designer  Can be hard to understand the structure of the model  Mapping Details windows doesn’t have details of storage model• Overcome these limitations with the Model Browser Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Agenda Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Agenda• Introduction Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Agenda• Introduction• Creating and Using an Entity Data Model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Agenda• Introduction• Creating and Using an Entity Data Model• Entity Data Model in the Raw Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Agenda• Introduction• Creating and Using an Entity Data Model• Entity Data Model in the Raw• Using Stored Procedures in the Model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Entity Data Model in the Raw Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Entity Data Model in the Raw• Designer is a graphical view only of the conceptual model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Entity Data Model in the Raw• Designer is a graphical view only of the conceptual model  Exposes most, but not all, features Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Entity Data Model in the Raw• Designer is a graphical view only of the conceptual model  Exposes most, but not all, features  Ultimately, just a pretty face on the XML Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Entity Data Model in the Raw• Designer is a graphical view only of the conceptual model  Exposes most, but not all, features  Ultimately, just a pretty face on the XML• Need to have a basic understanding of the XML Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Entity Data Model in the Raw• Designer is a graphical view only of the conceptual model  Exposes most, but not all, features  Ultimately, just a pretty face on the XML• Need to have a basic understanding of the XML  Sometimes have to manipulate the XML directly Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Entity Data Model in the Raw• Designer is a graphical view only of the conceptual model  Exposes most, but not all, features  Ultimately, just a pretty face on the XML• Need to have a basic understanding of the XML  Sometimes have to manipulate the XML directly• Can use any text editor Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Entity Data Model in the Raw• Designer is a graphical view only of the conceptual model  Exposes most, but not all, features  Ultimately, just a pretty face on the XML• Need to have a basic understanding of the XML  Sometimes have to manipulate the XML directly• Can use any text editor  But Visual Studio XML editor provides color-coding, well- formedness checks, and Intellisense Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Entity Data Model in the Raw• Designer is a graphical view only of the conceptual model  Exposes most, but not all, features  Ultimately, just a pretty face on the XML• Need to have a basic understanding of the XML  Sometimes have to manipulate the XML directly• Can use any text editor  But Visual Studio XML editor provides color-coding, well- formedness checks, and Intellisense• Can’t have open in designer and XML simultaneously Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • XML Definition Languages Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • XML Definition Languages• One for each model: Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • XML Definition Languages• One for each model:  Conceptual model uses Conceptual Schema Definition Language (CSDL) Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • XML Definition Languages• One for each model:  Conceptual model uses Conceptual Schema Definition Language (CSDL)  Storage model uses Store Schema Definition Language (SSDL) Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • XML Definition Languages• One for each model:  Conceptual model uses Conceptual Schema Definition Language (CSDL)  Storage model uses Store Schema Definition Language (SSDL)  Mapping model uses Mapping Specification Language (MSL) Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • XML Definition Languages• One for each model:  Conceptual model uses Conceptual Schema Definition Language (CSDL)  Storage model uses Store Schema Definition Language (SSDL)  Mapping model uses Mapping Specification Language (MSL)• Visual Studio includes XML schema files Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Model Build Mechanics Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Model Build Mechanics• .edmx file contains XML for all three models Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Model Build Mechanics• .edmx file contains XML for all three models  Plus support for the graphical designer Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Model Build Mechanics• .edmx file contains XML for all three models  Plus support for the graphical designer• Saves as three files at build: Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Model Build Mechanics• .edmx file contains XML for all three models  Plus support for the graphical designer• Saves as three files at build:  Conceptual model to .csdl file Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Model Build Mechanics• .edmx file contains XML for all three models  Plus support for the graphical designer• Saves as three files at build:  Conceptual model to .csdl file  Storage model to .ssdl file Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Model Build Mechanics• .edmx file contains XML for all three models  Plus support for the graphical designer• Saves as three files at build:  Conceptual model to .csdl file  Storage model to .ssdl file  Mapping model to .msl file Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Model Build Mechanics• .edmx file contains XML for all three models  Plus support for the graphical designer• Saves as three files at build:  Conceptual model to .csdl file  Storage model to .ssdl file  Mapping model to .msl file• By default, stored in project assembly Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Model Build Mechanics• .edmx file contains XML for all three models  Plus support for the graphical designer• Saves as three files at build:  Conceptual model to .csdl file  Storage model to .ssdl file  Mapping model to .msl file• By default, stored in project assembly  Can output three physical files Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Model Build Mechanics• .edmx file contains XML for all three models  Plus support for the graphical designer• Saves as three files at build:  Conceptual model to .csdl file  Storage model to .ssdl file  Mapping model to .msl file• By default, stored in project assembly  Can output three physical files  Change the MetadataArtifactProcessing property of the entity container Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Agenda Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Agenda• Introduction Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Agenda• Introduction• Creating and Using an Entity Data Model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Agenda• Introduction• Creating and Using an Entity Data Model• Entity Data Model in the Raw Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Agenda• Introduction• Creating and Using an Entity Data Model• Entity Data Model in the Raw• Using Stored Procedures in the Model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Using Stored Procedures in theModel Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Using Stored Procedures in theModel• Entity Framework can automatically generate all code needed to do CRUD Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Using Stored Procedures in theModel• Entity Framework can automatically generate all code needed to do CRUD• Not necessarily ideal from DBA’s perspective Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Using Stored Procedures in theModel• Entity Framework can automatically generate all code needed to do CRUD• Not necessarily ideal from DBA’s perspective  Job is to make sure data is secure, performs well, is scalable, and meets needs of the application Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Using Stored Procedures in theModel• Entity Framework can automatically generate all code needed to do CRUD• Not necessarily ideal from DBA’s perspective  Job is to make sure data is secure, performs well, is scalable, and meets needs of the application  Dynamic SQL complicates the job Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Using Stored Procedures in theModel• Entity Framework can automatically generate all code needed to do CRUD• Not necessarily ideal from DBA’s perspective  Job is to make sure data is secure, performs well, is scalable, and meets needs of the application  Dynamic SQL complicates the job• Stored procedures vs. dynamic code Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Using Stored Procedures in theModel• Entity Framework can automatically generate all code needed to do CRUD• Not necessarily ideal from DBA’s perspective  Job is to make sure data is secure, performs well, is scalable, and meets needs of the application  Dynamic SQL complicates the job• Stored procedures vs. dynamic code Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Using Stored Procedures in theModel• Entity Framework can automatically generate all code needed to do CRUD• Not necessarily ideal from DBA’s perspective  Job is to make sure data is secure, performs well, is scalable, and meets needs of the application  Dynamic SQL complicates the job• Stored procedures vs. dynamic code  Pick one or the other and go for it Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Using Stored Procedures in theModel• Entity Framework can automatically generate all code needed to do CRUD• Not necessarily ideal from DBA’s perspective  Job is to make sure data is secure, performs well, is scalable, and meets needs of the application  Dynamic SQL complicates the job• Stored procedures vs. dynamic code  Pick one or the other and go for it• Entity Framework does both well Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Using Stored Procedures in theModel• Entity Framework can automatically generate all code needed to do CRUD• Not necessarily ideal from DBA’s perspective  Job is to make sure data is secure, performs well, is scalable, and meets needs of the application  Dynamic SQL complicates the job• Stored procedures vs. dynamic code  Pick one or the other and go for it• Entity Framework does both well  Current version generates good code, mostly Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Ways to Use Stored Procedures Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Ways to Use Stored Procedures• Few different ways Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Ways to Use Stored Procedures• Few different ways  Replace an entity’s insert, update, and delete functions to use stored procedures Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Ways to Use Stored Procedures• Few different ways  Replace an entity’s insert, update, and delete functions to use stored procedures  Use stored procedures that return data to entities are scalar values Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Ways to Use Stored Procedures• Few different ways  Replace an entity’s insert, update, and delete functions to use stored procedures  Use stored procedures that return data to entities are scalar values• Entity Framework uses terms stored procedure and function interchangeably Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Updating the Model from theDatabase Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Updating the Model from theDatabase• Have to include stored procedures in the model before you can use them Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Updating the Model from theDatabase• Have to include stored procedures in the model before you can use them  Only imported tables and views Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Updating the Model from theDatabase• Have to include stored procedures in the model before you can use them  Only imported tables and views• Entity Framework supports updating the model from the database Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Updating the Model from theDatabase• Have to include stored procedures in the model before you can use them  Only imported tables and views• Entity Framework supports updating the model from the database• Will use several stored procedures Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Updating the Model from theDatabase• Have to include stored procedures in the model before you can use them  Only imported tables and views• Entity Framework supports updating the model from the database• Will use several stored procedures  InsertCustomer, UpdateCustomer, and DeleteCustomer Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Updating the Model from theDatabase• Have to include stored procedures in the model before you can use them  Only imported tables and views• Entity Framework supports updating the model from the database• Will use several stored procedures  InsertCustomer, UpdateCustomer, and DeleteCustomer  GetCustomersByRegion Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Updating the Model from theDatabase• Have to include stored procedures in the model before you can use them  Only imported tables and views• Entity Framework supports updating the model from the database• Will use several stored procedures  InsertCustomer, UpdateCustomer, and DeleteCustomer  GetCustomersByRegion  GetProductListByCategory Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Updating the Model from theDatabase• Have to include stored procedures in the model before you can use them  Only imported tables and views• Entity Framework supports updating the model from the database• Will use several stored procedures  InsertCustomer, UpdateCustomer, and DeleteCustomer  GetCustomersByRegion  GetProductListByCategory  GetProductCategoryAveragePrice Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Using Stored Procedures toChange an Entity Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Using Stored Procedures toChange an Entity• One of the most common ways to use stored procedures Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Using Stored Procedures toChange an Entity• One of the most common ways to use stored procedures• Replaces Entity Framework default behavior for an entity Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Using Stored Procedures toChange an Entity• One of the most common ways to use stored procedures• Replaces Entity Framework default behavior for an entity• Will use the Customer object Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Using Stored Procedures thatRead Data Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Using Stored Procedures thatRead Data• Use stored procedures that read data in the model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Using Stored Procedures thatRead Data• Use stored procedures that read data in the model  Materialize an entity object Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Using Stored Procedures thatRead Data• Use stored procedures that read data in the model  Materialize an entity object  Random sets of data Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Using Stored Procedures thatRead Data• Use stored procedures that read data in the model  Materialize an entity object  Random sets of data• GetCustomersByRegion returns all of the fields of the Customer table Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Using Stored Procedures thatRead Data• Use stored procedures that read data in the model  Materialize an entity object  Random sets of data• GetCustomersByRegion returns all of the fields of the Customer table• GetProductListByCategory returns fields from the Product and ProductCategory tables Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Using Stored Procedures thatRead Data• Use stored procedures that read data in the model  Materialize an entity object  Random sets of data• GetCustomersByRegion returns all of the fields of the Customer table• GetProductListByCategory returns fields from the Product and ProductCategory tables• Complex type Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Using Stored Procedures thatRead Data• Use stored procedures that read data in the model  Materialize an entity object  Random sets of data• GetCustomersByRegion returns all of the fields of the Customer table• GetProductListByCategory returns fields from the Product and ProductCategory tables• Complex type  Neither an entity or scalar type Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Using Stored Procedures thatRead Data• Use stored procedures that read data in the model  Materialize an entity object  Random sets of data• GetCustomersByRegion returns all of the fields of the Customer table• GetProductListByCategory returns fields from the Product and ProductCategory tables• Complex type  Neither an entity or scalar type  Use Model Browser to work with Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Using Stored Procedures thatReturn a Scalar Value Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Using Stored Procedures thatReturn a Scalar Value• Another option is to retrieve a scalar value from a stored procedure Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Using Stored Procedures thatReturn a Scalar Value• Another option is to retrieve a scalar value from a stored procedure• Dirty little secret Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Using Stored Procedures thatReturn a Scalar Value• Another option is to retrieve a scalar value from a stored procedure• Dirty little secret  Stored procedure still returns a result set Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Using Stored Procedures thatReturn a Scalar Value• Another option is to retrieve a scalar value from a stored procedure• Dirty little secret  Stored procedure still returns a result set  Entity Framework extracts the value, sort of Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Learn More! Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Learn More!• This is an excerpt from a larger course. Visit www.learnnowonline.com for the full details! Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Learn More!• This is an excerpt from a larger course. Visit www.learnnowonline.com for the full details! Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Learn More!• This is an excerpt from a larger course. Visit www.learnnowonline.com for the full details!• Learn more about Entity Framework on SlideShare: Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • Learn More!• This is an excerpt from a larger course. Visit www.learnnowonline.com for the full details!• Learn more about Entity Framework on SlideShare:  Introducing the Entity Framework Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company