SlideShare ist ein Scribd-Unternehmen logo
1 von 162
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 Data
Model




         Learn More @ http://www.learnnowonline.com
            Copyright © by Application Developers Training Company
Creating and Using an Entity Data
Model
• Can create from scratch using XML




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Creating and Using an Entity Data
Model
• 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 Data
Model
• 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 Data
Model
• 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 Data
Model
• 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 Data
Model
• 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 Using
Model-First Design




         Learn More @ http://www.learnnowonline.com
            Copyright © by Application Developers Training Company
Creating a Model Using
Model-First Design
• Database-first design is common




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Creating a Model Using
Model-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 Using
Model-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 Using
Model-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 Using
Model-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 Using
Model-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 Using
Model-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 the
Model Browser




         Learn More @ http://www.learnnowonline.com
            Copyright © by Application Developers Training Company
Explore the Model with the
Model 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 the
Model 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 the
Model 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 the
Model 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 the
Model




         Learn More @ http://www.learnnowonline.com
            Copyright © by Application Developers Training Company
Using Stored Procedures in the
Model
• 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 the
Model
• 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 the
Model
• 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 the
Model
• 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 the
Model
• 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 the
Model
• 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 the
Model
• 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 the
Model
• 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 the
Model
• 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 the
Database




         Learn More @ http://www.learnnowonline.com
            Copyright © by Application Developers Training Company
Updating the Model from the
Database
• 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 the
Database
• 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 the
Database
• 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 the
Database
• 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 the
Database
• 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 the
Database
• 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 the
Database
• 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 the
Database
• 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 to
Change an Entity




         Learn More @ http://www.learnnowonline.com
            Copyright © by Application Developers Training Company
Using Stored Procedures to
Change 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 to
Change 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 to
Change 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 that
Read Data




         Learn More @ http://www.learnnowonline.com
            Copyright © by Application Developers Training Company
Using Stored Procedures that
Read 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 that
Read 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 that
Read 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 that
Read 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 that
Read 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 that
Read 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 that
Read 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 that
Read 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 that
Return a Scalar Value




         Learn More @ http://www.learnnowonline.com
            Copyright © by Application Developers Training Company
Using Stored Procedures that
Return 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 that
Return 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 that
Return 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 that
Return 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

Weitere ähnliche Inhalte

Was ist angesagt?

BDA309 Build Your First Big Data Application on AWS
BDA309 Build Your First Big Data Application on AWSBDA309 Build Your First Big Data Application on AWS
BDA309 Build Your First Big Data Application on AWSAmazon Web Services
 
AWS Lambda use cases and best practices - Builders Day Israel
AWS Lambda use cases and best practices - Builders Day IsraelAWS Lambda use cases and best practices - Builders Day Israel
AWS Lambda use cases and best practices - Builders Day IsraelAmazon Web Services
 
AWS DeepLens Workshop_Build Computer Vision Applications
AWS DeepLens Workshop_Build Computer Vision Applications AWS DeepLens Workshop_Build Computer Vision Applications
AWS DeepLens Workshop_Build Computer Vision Applications Amazon Web Services
 
Building Serverless Websites with Lambda@Edge - AWS Online Tech Talks
Building Serverless Websites with Lambda@Edge - AWS Online Tech TalksBuilding Serverless Websites with Lambda@Edge - AWS Online Tech Talks
Building Serverless Websites with Lambda@Edge - AWS Online Tech TalksAmazon Web Services
 
Learn to Build a Cloud-Scale Website Powered by Amazon EFS - AWS Online Tech ...
Learn to Build a Cloud-Scale Website Powered by Amazon EFS - AWS Online Tech ...Learn to Build a Cloud-Scale Website Powered by Amazon EFS - AWS Online Tech ...
Learn to Build a Cloud-Scale Website Powered by Amazon EFS - AWS Online Tech ...Amazon Web Services
 
Module 4 - AWSome Day Online Conference 2018
Module 4 - AWSome Day Online Conference 2018Module 4 - AWSome Day Online Conference 2018
Module 4 - AWSome Day Online Conference 2018Amazon Web Services
 
Containerize Legacy .NET Framework Web Apps for Cloud Migration
Containerize Legacy .NET Framework Web Apps for Cloud Migration Containerize Legacy .NET Framework Web Apps for Cloud Migration
Containerize Legacy .NET Framework Web Apps for Cloud Migration Amazon Web Services
 
SRV205 Architectures and Strategies for Building Modern Applications on AWS
 SRV205 Architectures and Strategies for Building Modern Applications on AWS SRV205 Architectures and Strategies for Building Modern Applications on AWS
SRV205 Architectures and Strategies for Building Modern Applications on AWSAmazon Web Services
 
Module 2 - AWSome Day Online Conference 2018
Module 2 - AWSome Day Online Conference 2018Module 2 - AWSome Day Online Conference 2018
Module 2 - AWSome Day Online Conference 2018Amazon Web Services
 
How a Major Australian University Brought Backup to the Cloud
 How a Major Australian University Brought Backup to the Cloud How a Major Australian University Brought Backup to the Cloud
How a Major Australian University Brought Backup to the CloudAmazon Web Services
 
SID304 Threat Detection and Remediation with Amazon GuardDuty
 SID304 Threat Detection and Remediation with Amazon GuardDuty SID304 Threat Detection and Remediation with Amazon GuardDuty
SID304 Threat Detection and Remediation with Amazon GuardDutyAmazon Web Services
 
Module 2 AWS Foundational Services - AWSome Day Online Conference
Module 2 AWS Foundational Services - AWSome Day Online Conference Module 2 AWS Foundational Services - AWSome Day Online Conference
Module 2 AWS Foundational Services - AWSome Day Online Conference Amazon Web Services
 
Accelerating Containerized Workloads with Amazon EC2 Spot Instances - AWS Onl...
Accelerating Containerized Workloads with Amazon EC2 Spot Instances - AWS Onl...Accelerating Containerized Workloads with Amazon EC2 Spot Instances - AWS Onl...
Accelerating Containerized Workloads with Amazon EC2 Spot Instances - AWS Onl...Amazon Web Services
 
Module 3 - AWSome Day Online Conference 2018
Module 3 - AWSome Day Online Conference 2018Module 3 - AWSome Day Online Conference 2018
Module 3 - AWSome Day Online Conference 2018Amazon Web Services
 
Develop Containerized Apps with AWS Fargate
Develop Containerized Apps with AWS Fargate Develop Containerized Apps with AWS Fargate
Develop Containerized Apps with AWS Fargate Amazon Web Services
 
Analyze your Data Lake, Fast @ Any Scale - AWS Online Tech Talks
Analyze your Data Lake, Fast @ Any Scale - AWS Online Tech TalksAnalyze your Data Lake, Fast @ Any Scale - AWS Online Tech Talks
Analyze your Data Lake, Fast @ Any Scale - AWS Online Tech TalksAmazon Web Services
 
Interstella GTC: Monolith to Microservices with ECS
Interstella GTC: Monolith to Microservices with ECSInterstella GTC: Monolith to Microservices with ECS
Interstella GTC: Monolith to Microservices with ECSAmazon Web Services
 
SID201 Overview of AWS Identity, Directory, and Access Services
 SID201 Overview of AWS Identity, Directory, and Access Services SID201 Overview of AWS Identity, Directory, and Access Services
SID201 Overview of AWS Identity, Directory, and Access ServicesAmazon Web Services
 
Amazon S3_Updates and Best Practices
Amazon S3_Updates and Best Practices Amazon S3_Updates and Best Practices
Amazon S3_Updates and Best Practices Amazon Web Services
 

Was ist angesagt? (20)

BDA309 Build Your First Big Data Application on AWS
BDA309 Build Your First Big Data Application on AWSBDA309 Build Your First Big Data Application on AWS
BDA309 Build Your First Big Data Application on AWS
 
AWS Lambda use cases and best practices - Builders Day Israel
AWS Lambda use cases and best practices - Builders Day IsraelAWS Lambda use cases and best practices - Builders Day Israel
AWS Lambda use cases and best practices - Builders Day Israel
 
AWS DeepLens Workshop_Build Computer Vision Applications
AWS DeepLens Workshop_Build Computer Vision Applications AWS DeepLens Workshop_Build Computer Vision Applications
AWS DeepLens Workshop_Build Computer Vision Applications
 
Building Serverless Websites with Lambda@Edge - AWS Online Tech Talks
Building Serverless Websites with Lambda@Edge - AWS Online Tech TalksBuilding Serverless Websites with Lambda@Edge - AWS Online Tech Talks
Building Serverless Websites with Lambda@Edge - AWS Online Tech Talks
 
Learn to Build a Cloud-Scale Website Powered by Amazon EFS - AWS Online Tech ...
Learn to Build a Cloud-Scale Website Powered by Amazon EFS - AWS Online Tech ...Learn to Build a Cloud-Scale Website Powered by Amazon EFS - AWS Online Tech ...
Learn to Build a Cloud-Scale Website Powered by Amazon EFS - AWS Online Tech ...
 
Module 4 - AWSome Day Online Conference 2018
Module 4 - AWSome Day Online Conference 2018Module 4 - AWSome Day Online Conference 2018
Module 4 - AWSome Day Online Conference 2018
 
Containerize Legacy .NET Framework Web Apps for Cloud Migration
Containerize Legacy .NET Framework Web Apps for Cloud Migration Containerize Legacy .NET Framework Web Apps for Cloud Migration
Containerize Legacy .NET Framework Web Apps for Cloud Migration
 
SRV205 Architectures and Strategies for Building Modern Applications on AWS
 SRV205 Architectures and Strategies for Building Modern Applications on AWS SRV205 Architectures and Strategies for Building Modern Applications on AWS
SRV205 Architectures and Strategies for Building Modern Applications on AWS
 
Module 2 - AWSome Day Online Conference 2018
Module 2 - AWSome Day Online Conference 2018Module 2 - AWSome Day Online Conference 2018
Module 2 - AWSome Day Online Conference 2018
 
How a Major Australian University Brought Backup to the Cloud
 How a Major Australian University Brought Backup to the Cloud How a Major Australian University Brought Backup to the Cloud
How a Major Australian University Brought Backup to the Cloud
 
SID304 Threat Detection and Remediation with Amazon GuardDuty
 SID304 Threat Detection and Remediation with Amazon GuardDuty SID304 Threat Detection and Remediation with Amazon GuardDuty
SID304 Threat Detection and Remediation with Amazon GuardDuty
 
Module 2 AWS Foundational Services - AWSome Day Online Conference
Module 2 AWS Foundational Services - AWSome Day Online Conference Module 2 AWS Foundational Services - AWSome Day Online Conference
Module 2 AWS Foundational Services - AWSome Day Online Conference
 
Accelerating Containerized Workloads with Amazon EC2 Spot Instances - AWS Onl...
Accelerating Containerized Workloads with Amazon EC2 Spot Instances - AWS Onl...Accelerating Containerized Workloads with Amazon EC2 Spot Instances - AWS Onl...
Accelerating Containerized Workloads with Amazon EC2 Spot Instances - AWS Onl...
 
Amazon RDS_Deep Dive - SRV310
Amazon RDS_Deep Dive - SRV310 Amazon RDS_Deep Dive - SRV310
Amazon RDS_Deep Dive - SRV310
 
Module 3 - AWSome Day Online Conference 2018
Module 3 - AWSome Day Online Conference 2018Module 3 - AWSome Day Online Conference 2018
Module 3 - AWSome Day Online Conference 2018
 
Develop Containerized Apps with AWS Fargate
Develop Containerized Apps with AWS Fargate Develop Containerized Apps with AWS Fargate
Develop Containerized Apps with AWS Fargate
 
Analyze your Data Lake, Fast @ Any Scale - AWS Online Tech Talks
Analyze your Data Lake, Fast @ Any Scale - AWS Online Tech TalksAnalyze your Data Lake, Fast @ Any Scale - AWS Online Tech Talks
Analyze your Data Lake, Fast @ Any Scale - AWS Online Tech Talks
 
Interstella GTC: Monolith to Microservices with ECS
Interstella GTC: Monolith to Microservices with ECSInterstella GTC: Monolith to Microservices with ECS
Interstella GTC: Monolith to Microservices with ECS
 
SID201 Overview of AWS Identity, Directory, and Access Services
 SID201 Overview of AWS Identity, Directory, and Access Services SID201 Overview of AWS Identity, Directory, and Access Services
SID201 Overview of AWS Identity, Directory, and Access Services
 
Amazon S3_Updates and Best Practices
Amazon S3_Updates and Best Practices Amazon S3_Updates and Best Practices
Amazon S3_Updates and Best Practices
 

Andere mochten auch (20)

Entity Framework - Entity Data Model (edm)
Entity Framework - Entity Data Model (edm)Entity Framework - Entity Data Model (edm)
Entity Framework - Entity Data Model (edm)
 
Linq to entity
Linq to entityLinq to entity
Linq to entity
 
Linq e Ef
Linq e EfLinq e Ef
Linq e Ef
 
LINQ for absolute beginners
LINQ for absolute beginnersLINQ for absolute beginners
LINQ for absolute beginners
 
B_110500002
B_110500002B_110500002
B_110500002
 
20130329 introduction to linq
20130329 introduction to linq20130329 introduction to linq
20130329 introduction to linq
 
Ling to SQL and Entity Framework performance analysis
Ling to SQL and Entity Framework performance analysisLing to SQL and Entity Framework performance analysis
Ling to SQL and Entity Framework performance analysis
 
Linq
LinqLinq
Linq
 
Linq intro
Linq introLinq intro
Linq intro
 
Entity Framework - Queries
Entity Framework -  QueriesEntity Framework -  Queries
Entity Framework - Queries
 
Entity framework
Entity frameworkEntity framework
Entity framework
 
LINQ
LINQLINQ
LINQ
 
LINQ and LINQPad
LINQ and LINQPadLINQ and LINQPad
LINQ and LINQPad
 
PostCss
PostCssPostCss
PostCss
 
Think in linq
Think in linqThink in linq
Think in linq
 
Im information systems
Im   information systemsIm   information systems
Im information systems
 
メタプログラミング C#
メタプログラミング C#メタプログラミング C#
メタプログラミング C#
 
The Zachman Framework Unlocked
The Zachman Framework UnlockedThe Zachman Framework Unlocked
The Zachman Framework Unlocked
 
C# 式木 (Expression Tree) ~ LINQをより深く理解するために ~
C# 式木 (Expression Tree) ~ LINQをより深く理解するために ~C# 式木 (Expression Tree) ~ LINQをより深く理解するために ~
C# 式木 (Expression Tree) ~ LINQをより深く理解するために ~
 
LINQ in C#
LINQ in C#LINQ in C#
LINQ in C#
 

Ähnlich wie The Entity Data Model

SharePoint Document Management
SharePoint Document ManagementSharePoint Document Management
SharePoint Document ManagementLearnNowOnline
 
What's new in Silverlight 5
What's new in Silverlight 5What's new in Silverlight 5
What's new in Silverlight 5LearnNowOnline
 
Introducing the Entity Framework
Introducing the Entity FrameworkIntroducing the Entity Framework
Introducing the Entity FrameworkLearnNowOnline
 
WPF: Working with Data
WPF: Working with DataWPF: Working with Data
WPF: Working with DataLearnNowOnline
 
Object-Oriented JavaScript
Object-Oriented JavaScriptObject-Oriented JavaScript
Object-Oriented JavaScriptLearnNowOnline
 
Using The .NET Framework
Using The .NET FrameworkUsing The .NET Framework
Using The .NET FrameworkLearnNowOnline
 
Managing site collections
Managing site collectionsManaging site collections
Managing site collectionsLearnNowOnline
 
Building Windows 8 Metro Style Applications Using JavaScript and HTML5
Building Windows 8 Metro Style Applications Using JavaScript and HTML5Building Windows 8 Metro Style Applications Using JavaScript and HTML5
Building Windows 8 Metro Style Applications Using JavaScript and HTML5LearnNowOnline
 
Bring a Web Page Alive with jQuery
Bring a Web Page Alive with jQueryBring a Web Page Alive with jQuery
Bring a Web Page Alive with jQueryLearnNowOnline
 
.NET Variables and Data Types
.NET Variables and Data Types.NET Variables and Data Types
.NET Variables and Data TypesLearnNowOnline
 
Object oriented techniques
Object oriented techniquesObject oriented techniques
Object oriented techniquesLearnNowOnline
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVCLearnNowOnline
 
Sql 2012 development and programming
Sql 2012  development and programmingSql 2012  development and programming
Sql 2012 development and programmingLearnNowOnline
 
New in the Visual Studio 2012 IDE
New in the Visual Studio 2012 IDENew in the Visual Studio 2012 IDE
New in the Visual Studio 2012 IDELearnNowOnline
 

Ähnlich wie The Entity Data Model (20)

SharePoint Document Management
SharePoint Document ManagementSharePoint Document Management
SharePoint Document Management
 
WPF Binding
WPF BindingWPF Binding
WPF Binding
 
What's new in Silverlight 5
What's new in Silverlight 5What's new in Silverlight 5
What's new in Silverlight 5
 
Introducing the Entity Framework
Introducing the Entity FrameworkIntroducing the Entity Framework
Introducing the Entity Framework
 
WPF: Working with Data
WPF: Working with DataWPF: Working with Data
WPF: Working with Data
 
Object-Oriented JavaScript
Object-Oriented JavaScriptObject-Oriented JavaScript
Object-Oriented JavaScript
 
Using The .NET Framework
Using The .NET FrameworkUsing The .NET Framework
Using The .NET Framework
 
Managing site collections
Managing site collectionsManaging site collections
Managing site collections
 
Building Windows 8 Metro Style Applications Using JavaScript and HTML5
Building Windows 8 Metro Style Applications Using JavaScript and HTML5Building Windows 8 Metro Style Applications Using JavaScript and HTML5
Building Windows 8 Metro Style Applications Using JavaScript and HTML5
 
Bring a Web Page Alive with jQuery
Bring a Web Page Alive with jQueryBring a Web Page Alive with jQuery
Bring a Web Page Alive with jQuery
 
.NET Variables and Data Types
.NET Variables and Data Types.NET Variables and Data Types
.NET Variables and Data Types
 
Object oriented techniques
Object oriented techniquesObject oriented techniques
Object oriented techniques
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
 
Introducing LINQ
Introducing LINQIntroducing LINQ
Introducing LINQ
 
Sql 2012 development and programming
Sql 2012  development and programmingSql 2012  development and programming
Sql 2012 development and programming
 
Web API HTTP Pipeline
Web API HTTP PipelineWeb API HTTP Pipeline
Web API HTTP Pipeline
 
Web API Basics
Web API BasicsWeb API Basics
Web API Basics
 
SQL Server: Security
SQL Server: SecuritySQL Server: Security
SQL Server: Security
 
Alfresco content model
Alfresco content modelAlfresco content model
Alfresco content model
 
New in the Visual Studio 2012 IDE
New in the Visual Studio 2012 IDENew in the Visual Studio 2012 IDE
New in the Visual Studio 2012 IDE
 

Mehr von LearnNowOnline

Windows 8: Shapes and Geometries
Windows 8: Shapes and GeometriesWindows 8: Shapes and Geometries
Windows 8: Shapes and GeometriesLearnNowOnline
 
SQL: Permissions and Data Protection
SQL: Permissions and Data ProtectionSQL: Permissions and Data Protection
SQL: Permissions and Data ProtectionLearnNowOnline
 
Attributes, reflection, and dynamic programming
Attributes, reflection, and dynamic programmingAttributes, reflection, and dynamic programming
Attributes, reflection, and dynamic programmingLearnNowOnline
 
Asynchronous Programming
Asynchronous ProgrammingAsynchronous Programming
Asynchronous ProgrammingLearnNowOnline
 
SharePoint: Introduction to InfoPath
SharePoint: Introduction to InfoPathSharePoint: Introduction to InfoPath
SharePoint: Introduction to InfoPathLearnNowOnline
 
KnockOutJS with ASP.NET MVC
KnockOutJS with ASP.NET MVCKnockOutJS with ASP.NET MVC
KnockOutJS with ASP.NET MVCLearnNowOnline
 
Expression Blend Motion & Interaction Design
Expression Blend Motion & Interaction DesignExpression Blend Motion & Interaction Design
Expression Blend Motion & Interaction DesignLearnNowOnline
 
Working with Controllers and Actions in MVC
Working with Controllers and Actions in MVCWorking with Controllers and Actions in MVC
Working with Controllers and Actions in MVCLearnNowOnline
 
Creating a User Interface
Creating a User InterfaceCreating a User Interface
Creating a User InterfaceLearnNowOnline
 
.Net branching and flow control
.Net branching and flow control.Net branching and flow control
.Net branching and flow controlLearnNowOnline
 

Mehr von LearnNowOnline (12)

Windows 8: Shapes and Geometries
Windows 8: Shapes and GeometriesWindows 8: Shapes and Geometries
Windows 8: Shapes and Geometries
 
SQL: Permissions and Data Protection
SQL: Permissions and Data ProtectionSQL: Permissions and Data Protection
SQL: Permissions and Data Protection
 
Attributes, reflection, and dynamic programming
Attributes, reflection, and dynamic programmingAttributes, reflection, and dynamic programming
Attributes, reflection, and dynamic programming
 
Asynchronous Programming
Asynchronous ProgrammingAsynchronous Programming
Asynchronous Programming
 
A tour of SQL Server
A tour of SQL ServerA tour of SQL Server
A tour of SQL Server
 
Generics
GenericsGenerics
Generics
 
SharePoint: Introduction to InfoPath
SharePoint: Introduction to InfoPathSharePoint: Introduction to InfoPath
SharePoint: Introduction to InfoPath
 
KnockOutJS with ASP.NET MVC
KnockOutJS with ASP.NET MVCKnockOutJS with ASP.NET MVC
KnockOutJS with ASP.NET MVC
 
Expression Blend Motion & Interaction Design
Expression Blend Motion & Interaction DesignExpression Blend Motion & Interaction Design
Expression Blend Motion & Interaction Design
 
Working with Controllers and Actions in MVC
Working with Controllers and Actions in MVCWorking with Controllers and Actions in MVC
Working with Controllers and Actions in MVC
 
Creating a User Interface
Creating a User InterfaceCreating a User Interface
Creating a User Interface
 
.Net branching and flow control
.Net branching and flow control.Net branching and flow control
.Net branching and flow control
 

Kürzlich hochgeladen

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 

Kürzlich hochgeladen (20)

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 

The Entity Data Model

  • 1. The Entity Data Model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 2. Objectives Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 3. Objectives • Learn how to create and use an Entity Data Model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 4. 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
  • 5. 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
  • 6. Agenda Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 7. Agenda • Introduction Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 8. Agenda • Introduction • Creating and Using an Entity Data Model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 9. 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
  • 10. 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
  • 11. Introduction Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 12. Introduction • Key link between entity objects and data Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 13. Introduction • Key link between entity objects and data  Conceptual model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 14. Introduction • Key link between entity objects and data  Conceptual model  Storage model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 15. 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
  • 16. 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
  • 17. 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
  • 18. 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
  • 19. 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
  • 20. 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
  • 21. The Models within the Model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 22. The Models within the Model • Conceptual Model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 23. The Models within the Model • Conceptual Model  The actual Entity Data Model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 24. 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
  • 25. 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
  • 26. 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
  • 27. 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
  • 28. 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
  • 29. 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
  • 30. 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
  • 31. 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
  • 32. Agenda Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 33. Agenda • Introduction Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 34. Agenda • Introduction • Creating and Using an Entity Data Model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 35. 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
  • 36. 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
  • 37. Creating and Using an Entity Data Model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 38. Creating and Using an Entity Data Model • Can create from scratch using XML Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 39. Creating and Using an Entity Data Model • Can create from scratch using XML  More productive using the designer Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 40. Creating and Using an Entity Data Model • 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
  • 41. Creating and Using an Entity Data Model • 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
  • 42. Creating and Using an Entity Data Model • 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
  • 43. Creating and Using an Entity Data Model • 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
  • 44. Creating a Model Using Database- First Design Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 45. 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
  • 46. 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
  • 47. 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
  • 48. 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
  • 49. 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
  • 50. Multiplicity Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 51. Multiplicity • Used with associations Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 52. 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
  • 53. 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
  • 54. 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
  • 55. 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
  • 56. 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
  • 57. 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
  • 58. 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
  • 59. 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
  • 60. 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
  • 61. 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
  • 62. Entity Data Model Object Properties Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 63. Entity Data Model Object Properties • Typical for Visual Studio Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 64. 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
  • 65. 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
  • 66. Creating a Model Using Model-First Design Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 67. Creating a Model Using Model-First Design • Database-first design is common Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 68. Creating a Model Using Model-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
  • 69. Creating a Model Using Model-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
  • 70. Creating a Model Using Model-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
  • 71. Creating a Model Using Model-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
  • 72. Creating a Model Using Model-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
  • 73. Creating a Model Using Model-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
  • 74. Sled Dog Event Registration Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 75. 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
  • 76. Explore the Model with the Model Browser Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 77. Explore the Model with the Model Browser • Working with large models can be hard in the designer Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 78. Explore the Model with the Model 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
  • 79. Explore the Model with the Model 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
  • 80. Explore the Model with the Model 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
  • 81. Agenda Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 82. Agenda • Introduction Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 83. Agenda • Introduction • Creating and Using an Entity Data Model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 84. 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
  • 85. 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
  • 86. Entity Data Model in the Raw Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 87. 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
  • 88. 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
  • 89. 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
  • 90. 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
  • 91. 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
  • 92. 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
  • 93. 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
  • 94. 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
  • 95. XML Definition Languages Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 96. XML Definition Languages • One for each model: Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 97. 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
  • 98. 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
  • 99. 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
  • 100. 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
  • 101. Model Build Mechanics Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 102. Model Build Mechanics • .edmx file contains XML for all three models Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 103. 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
  • 104. 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
  • 105. 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
  • 106. 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
  • 107. 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
  • 108. 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
  • 109. 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
  • 110. 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
  • 111. Agenda Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 112. Agenda • Introduction Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 113. Agenda • Introduction • Creating and Using an Entity Data Model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 114. 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
  • 115. 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
  • 116. Using Stored Procedures in the Model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 117. Using Stored Procedures in the Model • Entity Framework can automatically generate all code needed to do CRUD Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 118. Using Stored Procedures in the Model • 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
  • 119. Using Stored Procedures in the Model • 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
  • 120. Using Stored Procedures in the Model • 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
  • 121. Using Stored Procedures in the Model • 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
  • 122. Using Stored Procedures in the Model • 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
  • 123. Using Stored Procedures in the Model • 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
  • 124. Using Stored Procedures in the Model • 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
  • 125. Using Stored Procedures in the Model • 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
  • 126. Ways to Use Stored Procedures Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 127. Ways to Use Stored Procedures • Few different ways Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 128. 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
  • 129. 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
  • 130. 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
  • 131. Updating the Model from the Database Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 132. Updating the Model from the Database • 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
  • 133. Updating the Model from the Database • 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
  • 134. Updating the Model from the Database • 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
  • 135. Updating the Model from the Database • 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
  • 136. Updating the Model from the Database • 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
  • 137. Updating the Model from the Database • 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
  • 138. Updating the Model from the Database • 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
  • 139. Updating the Model from the Database • 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
  • 140. Using Stored Procedures to Change an Entity Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 141. Using Stored Procedures to Change an Entity • One of the most common ways to use stored procedures Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 142. Using Stored Procedures to Change 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
  • 143. Using Stored Procedures to Change 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
  • 144. Using Stored Procedures that Read Data Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 145. Using Stored Procedures that Read Data • Use stored procedures that read data in the model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 146. Using Stored Procedures that Read 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
  • 147. Using Stored Procedures that Read 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
  • 148. Using Stored Procedures that Read 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
  • 149. Using Stored Procedures that Read 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
  • 150. Using Stored Procedures that Read 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
  • 151. Using Stored Procedures that Read 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
  • 152. Using Stored Procedures that Read 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
  • 153. Using Stored Procedures that Return a Scalar Value Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 154. Using Stored Procedures that Return 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
  • 155. Using Stored Procedures that Return 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
  • 156. Using Stored Procedures that Return 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
  • 157. Using Stored Procedures that Return 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
  • 158. Learn More! Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 159. 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
  • 160. 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
  • 161. 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
  • 162. 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

Hinweis der Redaktion

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. DEMO: Try It Out!\n
  39. DEMO: Try It Out!\n
  40. DEMO: Try It Out!\n
  41. DEMO: Try It Out!\n
  42. DEMO: Try It Out!\n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. DEMO: Rest of section\n
  55. DEMO: Rest of section\n
  56. DEMO: Rest of section\n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. DEMO: Rest of Try It Now!\n
  65. DEMO: Rest of Try It Now!\n
  66. DEMO: Rest of Try It Now!\n
  67. DEMO: Rest of Try It Now!\n
  68. DEMO: Rest of Try It Now!\n
  69. DEMO: Rest of Try It Now!\n
  70. DEMO: Rest of Try It Now!\n
  71. DEMO: Rest of Try It Now!\n
  72. DEMO: Rest of Try It Now!\n
  73. DEMO: Rest of Try It Now!\n
  74. DEMO: Rest of Try It Now!\n
  75. DEMO: Rest of Try It Now!\n
  76. DEMO: Rest of Try It Now!\n
  77. DEMO: Rest of section\n
  78. DEMO: Rest of section\n
  79. DEMO: Rest of section\n
  80. DEMO: Rest of section\n
  81. \n
  82. \n
  83. \n
  84. \n
  85. \n
  86. \n
  87. \n
  88. \n
  89. \n
  90. \n
  91. \n
  92. \n
  93. DEMO: rest of section, Designer Section, Runtime Section, Conceptual Model XML, Storage Model XML, Mapping Model XML sections\n
  94. DEMO: rest of section, Designer Section, Runtime Section, Conceptual Model XML, Storage Model XML, Mapping Model XML sections\n
  95. DEMO: rest of section, Designer Section, Runtime Section, Conceptual Model XML, Storage Model XML, Mapping Model XML sections\n
  96. DEMO: rest of section, Designer Section, Runtime Section, Conceptual Model XML, Storage Model XML, Mapping Model XML sections\n
  97. DEMO: rest of section, Designer Section, Runtime Section, Conceptual Model XML, Storage Model XML, Mapping Model XML sections\n
  98. DEMO: rest of section\n
  99. DEMO: rest of section\n
  100. DEMO: rest of section\n
  101. DEMO: rest of section\n
  102. DEMO: rest of section\n
  103. DEMO: rest of section\n
  104. DEMO: rest of section\n
  105. DEMO: rest of section\n
  106. DEMO: rest of section\n
  107. \n
  108. \n
  109. \n
  110. \n
  111. \n
  112. \n
  113. \n
  114. \n
  115. \n
  116. \n
  117. \n
  118. \n
  119. \n
  120. \n
  121. \n
  122. \n
  123. \n
  124. DEMO: Try It Out!\n
  125. DEMO: Try It Out!\n
  126. DEMO: Try It Out!\n
  127. DEMO: Try It Out!\n
  128. DEMO: Try It Out!\n
  129. DEMO: Try It Out!\n
  130. DEMO: Try It Out!\n
  131. DEMO: Try It Out!\n
  132. DEMO: Try It Out!\n
  133. DEMO: Try It Out!\n
  134. DEMO: Try It Out!\n
  135. DEMO: Try It Out!\n
  136. DEMO: Try It Out!\n
  137. DEMO: Try It Out!\n
  138. DEMO: Try It Out!\n
  139. DEMO: Try It Out!\n
  140. DEMO: Try It Out!\n
  141. DEMO: Try It Out!\n
  142. DEMO: Try It Out!\n
  143. DEMO: Try It Out!\n
  144. DEMO: Try It Out!\n
  145. DEMO: Try It Out!\n
  146. DEMO: Try It Out!\n
  147. DEMO: rest of section\n
  148. DEMO: rest of section\n
  149. DEMO: rest of section\n
  150. DEMO: rest of section\n