SlideShare a Scribd company logo
1 of 281
Introducing the Entity
Framework




      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 about how object-relational mapping
  works to provide data access




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Objectives
• Learn about how object-relational mapping
  works to provide data access
• Understand what the Entity Framework is and
  how it can provide robust data access services to
  applications




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Objectives
• Learn about how object-relational mapping
  works to provide data access
• Understand what the Entity Framework is and
  how it can provide robust data access services to
  applications
• See how to build a database-first Entity Data
  Model using Visual Studio




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Objectives
• Learn about how object-relational mapping
  works to provide data access
• Understand what the Entity Framework is and
  how it can provide robust data access services to
  applications
• See how to build a database-first Entity Data
  Model using Visual Studio
• Explore the various Entity Framework APIs and
  tools

              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
• Object-Relational Mapping (ORM) and
  Data Access




           Learn More @ http://www.learnnowonline.com
              Copyright © by Application Developers Training Company
Agenda
• Object-Relational Mapping (ORM) and
  Data Access
• The Entity Framework and Data Model




           Learn More @ http://www.learnnowonline.com
              Copyright © by Application Developers Training Company
Agenda
• Object-Relational Mapping (ORM) and
  Data Access
• The Entity Framework and Data Model
• Building a Simple Application using Entity
  Framework




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Agenda
• Object-Relational Mapping (ORM) and
  Data Access
• The Entity Framework and Data Model
• Building a Simple Application using Entity
  Framework
• Entity Framework APIs and Tools




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Object-Relational Mapping (ORM)




         Learn More @ http://www.learnnowonline.com
            Copyright © by Application Developers Training Company
Object-Relational Mapping (ORM)
• Just about all applications make use of data




               Learn More @ http://www.learnnowonline.com
                  Copyright © by Application Developers Training Company
Object-Relational Mapping (ORM)
• Just about all applications make use of data
• Microsoft has a long history of providing data access
  technologies




               Learn More @ http://www.learnnowonline.com
                  Copyright © by Application Developers Training Company
Object-Relational Mapping (ORM)
• Just about all applications make use of data
• Microsoft has a long history of providing data access
  technologies
• But they have problems




               Learn More @ http://www.learnnowonline.com
                  Copyright © by Application Developers Training Company
Object-Relational Mapping (ORM)
• Just about all applications make use of data
• Microsoft has a long history of providing data access
  technologies
• But they have problems
    Too close to the metal




                Learn More @ http://www.learnnowonline.com
                   Copyright © by Application Developers Training Company
Object-Relational Mapping (ORM)
• Just about all applications make use of data
• Microsoft has a long history of providing data access
  technologies
• But they have problems
    Too close to the metal
    Use generic data objects




                Learn More @ http://www.learnnowonline.com
                   Copyright © by Application Developers Training Company
Object-Relational Mapping (ORM)
• Just about all applications make use of data
• Microsoft has a long history of providing data access
  technologies
• But they have problems
    Too close to the metal
    Use generic data objects
• Data access code is usually a lot of code




                Learn More @ http://www.learnnowonline.com
                   Copyright © by Application Developers Training Company
Object-Relational Mapping (ORM)
• Just about all applications make use of data
• Microsoft has a long history of providing data access
  technologies
• But they have problems
    Too close to the metal
    Use generic data objects
• Data access code is usually a lot of code
• Differences between objects and database



                Learn More @ http://www.learnnowonline.com
                   Copyright © by Application Developers Training Company
Object-Relational Mapping (ORM)
• Just about all applications make use of data
• Microsoft has a long history of providing data access
  technologies
• But they have problems
    Too close to the metal
    Use generic data objects
• Data access code is usually a lot of code
• Differences between objects and database
• Entity Framework bridges the gap


                Learn More @ http://www.learnnowonline.com
                   Copyright © by Application Developers Training Company
Object-Relational Mapping (ORM)
• Just about all applications make use of data
• Microsoft has a long history of providing data access
  technologies
• But they have problems
     Too close to the metal
     Use generic data objects
•   Data access code is usually a lot of code
•   Differences between objects and database
•   Entity Framework bridges the gap
•   Terminology: data store and database
                 Learn More @ http://www.learnnowonline.com
                    Copyright © by Application Developers Training Company
Object/Relational Differences




         Learn More @ http://www.learnnowonline.com
            Copyright © by Application Developers Training Company
Object/Relational Differences
• Inherent problems application has to overcome




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Object/Relational Differences
• Inherent problems application has to overcome
   Needs lots of code somewhere




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Object/Relational Differences
• Inherent problems application has to overcome
   Needs lots of code somewhere
   Big impact on application design, effort, and
    performance




               Learn More @ http://www.learnnowonline.com
                  Copyright © by Application Developers Training Company
Object/Relational Differences
• Inherent problems application has to overcome
    Needs lots of code somewhere
    Big impact on application design, effort, and
     performance
• Will discuss in the context of a relational
  database




                Learn More @ http://www.learnnowonline.com
                   Copyright © by Application Developers Training Company
Data Type Differences




         Learn More @ http://www.learnnowonline.com
            Copyright © by Application Developers Training Company
Data Type Differences
• Many kinds of data types




               Learn More @ http://www.learnnowonline.com
                  Copyright © by Application Developers Training Company
Data Type Differences
• Many kinds of data types
• SQL Server 2008 R2 data types:




               Learn More @ http://www.learnnowonline.com
                  Copyright © by Application Developers Training Company
Data Type Differences
• Many kinds of data types
• SQL Server 2008 R2 data types:
  bigint       binary            bit                       char                 CLR
  date         datetime          datetime2                 datetimeoffset       decimal
  float        hierarchyid       image                     int                  money
  nchar        ntext             numeric                   nvarchar             real
  rowversion   smalldatetime     smallint                  smallmoney           sql_variant
  table        text              time                      timestamp            tinyint
  varbinary    varchar           uniqueidentifier




                   Learn More @ http://www.learnnowonline.com
                       Copyright © by Application Developers Training Company
Data Type Differences
• Many kinds of data types
• SQL Server 2008 R2 data types:
  bigint       binary            bit                       char                 CLR
  date         datetime          datetime2                 datetimeoffset       decimal
  float        hierarchyid       image                     int                  money
  nchar        ntext             numeric                   nvarchar             real
  rowversion   smalldatetime     smallint                  smallmoney           sql_variant
  table        text              time                      timestamp            tinyint
  varbinary    varchar           uniqueidentifier




                   Learn More @ http://www.learnnowonline.com
                       Copyright © by Application Developers Training Company
Data Type Differences
• Many kinds of data types
• SQL Server 2008 R2 data types:
  bigint       binary            bit                       char                 CLR
  date         datetime          datetime2                 datetimeoffset       decimal
  float        hierarchyid       image                     int                  money
  nchar        ntext             numeric                   nvarchar             real
  rowversion   smalldatetime     smallint                  smallmoney           sql_variant
  table        text              time                      timestamp            tinyint
  varbinary    varchar           uniqueidentifier




                   Learn More @ http://www.learnnowonline.com
                       Copyright © by Application Developers Training Company
Data Type Differences
• Many kinds of data types
• SQL Server 2008 R2 data types:
  bigint       binary            bit                       char                 CLR
  date         datetime          datetime2                 datetimeoffset       decimal
  float        hierarchyid       image                     int                  money
  nchar        ntext             numeric                   nvarchar             real
  rowversion   smalldatetime     smallint                  smallmoney           sql_variant
  table        text              time                      timestamp            tinyint
  varbinary    varchar           uniqueidentifier




                   Learn More @ http://www.learnnowonline.com
                       Copyright © by Application Developers Training Company
Data Type Differences
• Many kinds of data types
• SQL Server 2008 R2 data types:
    bigint       binary            bit                       char                 CLR
    date         datetime          datetime2                 datetimeoffset       decimal
    float        hierarchyid       image                     int                  money
    nchar        ntext             numeric                   nvarchar             real
    rowversion   smalldatetime     smallint                  smallmoney           sql_variant
    table        text              time                      timestamp            tinyint
    varbinary    varchar           uniqueidentifier
•   Some have direct equivalents in .NET
•   Database types often have constraints
•   Binary data in the database can be anything
•   Dates and times are another issue
                     Learn More @ http://www.learnnowonline.com
                         Copyright © by Application Developers Training Company
Relationship Difference




         Learn More @ http://www.learnnowonline.com
            Copyright © by Application Developers Training Company
Relationship Difference
• Databases use foreign key constraints




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Relationship Difference
• Databases use foreign key constraints
• .NET objects use object references




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Relationship Difference
• Databases use foreign key constraints
• .NET objects use object references
• SalesOrderHeader and SalesOrderDetail tables




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Relationship Difference
• Databases use foreign key constraints
• .NET objects use object references
• SalesOrderHeader and SalesOrderDetail tables




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Relationship Difference
• Databases use foreign key constraints
• .NET objects use object references
• SalesOrderHeader and SalesOrderDetail tables




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Relationship Difference




         Learn More @ http://www.learnnowonline.com
            Copyright © by Application Developers Training Company
Relationship Difference
• Many-to-Many relationships




               Learn More @ http://www.learnnowonline.com
                  Copyright © by Application Developers Training Company
Relationship Difference
• Many-to-Many relationships
• In AdventureWorks, customers and addresses




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Relationship Difference
• Many-to-Many relationships
• In AdventureWorks, customers and addresses




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Relationship Difference
• Many-to-Many relationships
• In AdventureWorks, customers and addresses




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Relationship Difference
• Many-to-Many relationships
• In AdventureWorks, customers and addresses




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Relationship Difference
• Many-to-Many relationships
• In AdventureWorks, customers and addresses




• Not the default objects
                Learn More @ http://www.learnnowonline.com
                   Copyright © by Application Developers Training Company
Inheritance Difference




       Learn More @ http://www.learnnowonline.com
          Copyright © by Application Developers Training Company
Inheritance Difference
• .NET supports object inheritance




           Learn More @ http://www.learnnowonline.com
              Copyright © by Application Developers Training Company
Inheritance Difference
• .NET supports object inheritance
    No support for multiple inheritance




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Inheritance Difference
• .NET supports object inheritance
    No support for multiple inheritance
• Inheritance makes code simpler, maintainable, easier
  to debug




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Inheritance Difference
• .NET supports object inheritance
    No support for multiple inheritance
• Inheritance makes code simpler, maintainable, easier
  to debug
    Model hierarchies of objects




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Inheritance Difference
• .NET supports object inheritance
    No support for multiple inheritance
• Inheritance makes code simpler, maintainable, easier
  to debug
    Model hierarchies of objects
• Relational databases don’t support inheritance




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Inheritance Difference
• .NET supports object inheritance
    No support for multiple inheritance
• Inheritance makes code simpler, maintainable, easier
  to debug
    Model hierarchies of objects
• Relational databases don’t support inheritance
• Some ways to accomplish it




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Inheritance Difference
• .NET supports object inheritance
    No support for multiple inheritance
• Inheritance makes code simpler, maintainable, easier
  to debug
    Model hierarchies of objects
• Relational databases don’t support inheritance
• Some ways to accomplish it
    Table per type




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Inheritance Difference
• .NET supports object inheritance
    No support for multiple inheritance
• Inheritance makes code simpler, maintainable, easier
  to debug
    Model hierarchies of objects
• Relational databases don’t support inheritance
• Some ways to accomplish it
    Table per type
    Table per concrete type



             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Inheritance Difference
• .NET supports object inheritance
    No support for multiple inheritance
• Inheritance makes code simpler, maintainable, easier
  to debug
    Model hierarchies of objects
• Relational databases don’t support inheritance
• Some ways to accomplish it
    Table per type
    Table per concrete type
    Table per hierarchy


             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Inheritance Difference
• .NET supports object inheritance
    No support for multiple inheritance
• Inheritance makes code simpler, maintainable, easier
  to debug
    Model hierarchies of objects
• Relational databases don’t support inheritance
• Some ways to accomplish it
    Table per type
    Table per concrete type
    Table per hierarchy
• Have to manage special constraints
             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Identity/Equality Difference




          Learn More @ http://www.learnnowonline.com
             Copyright © by Application Developers Training Company
Identity/Equality Difference
• How do you tell two things are the same?




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Identity/Equality Difference
• How do you tell two things are the same?
• Database: identity of a row is the primary key




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Identity/Equality Difference
• How do you tell two things are the same?
• Database: identity of a row is the primary key
   Enforced by a primary key constraint




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Identity/Equality Difference
• How do you tell two things are the same?
• Database: identity of a row is the primary key
   Enforced by a primary key constraint
   Can use either natural or surrogate keys




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Identity/Equality Difference
• How do you tell two things are the same?
• Database: identity of a row is the primary key
   Enforced by a primary key constraint
   Can use either natural or surrogate keys
• Objects in object-oriented application




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Identity/Equality Difference
• How do you tell two things are the same?
• Database: identity of a row is the primary key
   Enforced by a primary key constraint
   Can use either natural or surrogate keys
• Objects in object-oriented application
   Two objects with the same data are not equal




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Identity/Equality Difference
• How do you tell two things are the same?
• Database: identity of a row is the primary key
   Enforced by a primary key constraint
   Can use either natural or surrogate keys
• Objects in object-oriented application
   Two objects with the same data are not equal
   Two variables, each with reference to different
    objects, are not equal




               Learn More @ http://www.learnnowonline.com
                  Copyright © by Application Developers Training Company
Identity/Equality Difference
• How do you tell two things are the same?
• Database: identity of a row is the primary key
   Enforced by a primary key constraint
   Can use either natural or surrogate keys
• Objects in object-oriented application
   Two objects with the same data are not equal
   Two variables, each with reference to different
    objects, are not equal
   Two variables with reference to same object are equal


              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Identity/Equality Difference
• How do you tell two things are the same?
• Database: identity of a row is the primary key
   Enforced by a primary key constraint
   Can use either natural or surrogate keys
• Objects in object-oriented application
   Two objects with the same data are not equal
   Two variables, each with reference to different
    objects, are not equal
   Two variables with reference to same object are equal
   Can make a custom definition

              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Handling the Differences




         Learn More @ http://www.learnnowonline.com
            Copyright © by Application Developers Training Company
Handling the Differences
• Can be an lot of work to handle object/relational
  differences




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Handling the Differences
• Can be an lot of work to handle object/relational
  differences
   But at least they are well understood




               Learn More @ http://www.learnnowonline.com
                  Copyright © by Application Developers Training Company
Handling the Differences
• Can be an lot of work to handle object/relational
  differences
   But at least they are well understood
   Doesn’t mean it’s easy




               Learn More @ http://www.learnnowonline.com
                  Copyright © by Application Developers Training Company
Handling the Differences
• Can be an lot of work to handle object/relational
  differences
   But at least they are well understood
   Doesn’t mean it’s easy
• Write the code yourself, or use a framework




               Learn More @ http://www.learnnowonline.com
                  Copyright © by Application Developers Training Company
Object-Relational Mapping (ORM)




         Learn More @ http://www.learnnowonline.com
            Copyright © by Application Developers Training Company
Object-Relational Mapping (ORM)
• Programming technique for conversion of
  incompatible types




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Object-Relational Mapping (ORM)
• Programming technique for conversion of
  incompatible types
• Most ORM tools rely on metadata about
  database and objects




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Object-Relational Mapping (ORM)
• Programming technique for conversion of
  incompatible types
• Most ORM tools rely on metadata about
  database and objects
• Clean separation of concerns




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Object-Relational Mapping (ORM)
• Programming technique for conversion of
  incompatible types
• Most ORM tools rely on metadata about
  database and objects
• Clean separation of concerns
• Key feature is mapping




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Object-Relational Mapping (ORM)
• Programming technique for conversion of
  incompatible types
• Most ORM tools rely on metadata about
  database and objects
• Clean separation of concerns
• Key feature is mapping
   Expresses how an object is related to a table




               Learn More @ http://www.learnnowonline.com
                  Copyright © by Application Developers Training Company
Object-Relational Mapping (ORM)
• Programming technique for conversion of
  incompatible types
• Most ORM tools rely on metadata about
  database and objects
• Clean separation of concerns
• Key feature is mapping
   Expresses how an object is related to a table
   ORM uses to manage conversion process



               Learn More @ http://www.learnnowonline.com
                  Copyright © by Application Developers Training Company
Object-Relational Mapping (ORM)
• Programming technique for conversion of
  incompatible types
• Most ORM tools rely on metadata about
  database and objects
• Clean separation of concerns
• Key feature is mapping
   Expresses how an object is related to a table
   ORM uses to manage conversion process
• ORM manages application’s interactions with
  database
               Learn More @ http://www.learnnowonline.com
                  Copyright © by Application Developers Training Company
Benefits to using an ORM




         Learn More @ http://www.learnnowonline.com
            Copyright © by Application Developers Training Company
Benefits to using an ORM
• Productivity




                 Learn More @ http://www.learnnowonline.com
                    Copyright © by Application Developers Training Company
Benefits to using an ORM
• Productivity
• Better application design




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Benefits to using an ORM
• Productivity
• Better application design
• Code reuse




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Benefits to using an ORM
•   Productivity
•   Better application design
•   Code reuse
•   Application maintainability




                Learn More @ http://www.learnnowonline.com
                   Copyright © by Application Developers Training Company
Benefits to using an ORM
•   Productivity
•   Better application design
•   Code reuse
•   Application maintainability
•   Potential downside: performance




               Learn More @ http://www.learnnowonline.com
                  Copyright © by Application Developers Training Company
Benefits to using an ORM
•   Productivity
•   Better application design
•   Code reuse
•   Application maintainability
•   Potential downside: performance
     More complex code




               Learn More @ http://www.learnnowonline.com
                  Copyright © by Application Developers Training Company
Benefits to using an ORM
•   Productivity
•   Better application design
•   Code reuse
•   Application maintainability
•   Potential downside: performance
     More complex code
     Means slower performance




               Learn More @ http://www.learnnowonline.com
                  Copyright © by Application Developers Training Company
Benefits to using an ORM
•   Productivity
•   Better application design
•   Code reuse
•   Application maintainability
•   Potential downside: performance
     More complex code
     Means slower performance
     But ORM code is likely to be well tuned



                 Learn More @ http://www.learnnowonline.com
                    Copyright © by Application Developers Training Company
Benefits to using an ORM
•   Productivity
•   Better application design
•   Code reuse
•   Application maintainability
•   Potential downside: performance
       More complex code
       Means slower performance
       But ORM code is likely to be well tuned
       Data access time may be minimal

                  Learn More @ http://www.learnnowonline.com
                     Copyright © by Application Developers Training Company
Benefits to using an ORM
•   Productivity
•   Better application design
•   Code reuse
•   Application maintainability
•   Potential downside: performance
       More complex code
       Means slower performance
       But ORM code is likely to be well tuned
       Data access time may be minimal
• Lots of ORMs available for .NET
                  Learn More @ http://www.learnnowonline.com
                     Copyright © by Application Developers Training Company
Generic Data Objects vs. Entity




         Learn More @ http://www.learnnowonline.com
            Copyright © by Application Developers Training Company
Generic Data Objects vs. Entity
• ADO.NET has long had generic data objects




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Generic Data Objects vs. Entity
• ADO.NET has long had generic data objects
• Most common:




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Generic Data Objects vs. Entity
• ADO.NET has long had generic data objects
• Most common:
   SqlConnection and OleDbConnection




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Generic Data Objects vs. Entity
• ADO.NET has long had generic data objects
• Most common:
   SqlConnection and OleDbConnection
   SqlDataAdapter and OleDbAdapter




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Generic Data Objects vs. Entity
• ADO.NET has long had generic data objects
• Most common:
   SqlConnection and OleDbConnection
   SqlDataAdapter and OleDbAdapter
   DataSet




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Generic Data Objects vs. Entity
• ADO.NET has long had generic data objects
• Most common:
     SqlConnection and OleDbConnection
     SqlDataAdapter and OleDbAdapter
     DataSet
     DataTable




               Learn More @ http://www.learnnowonline.com
                  Copyright © by Application Developers Training Company
Generic Data Objects vs. Entity
• ADO.NET has long had generic data objects
• Most common:
     SqlConnection and OleDbConnection
     SqlDataAdapter and OleDbAdapter
     DataSet
     DataTable
     SqlDataReader and OleDbDataReader




               Learn More @ http://www.learnnowonline.com
                  Copyright © by Application Developers Training Company
Generic Data Objects vs. Entity
• ADO.NET has long had generic data objects
• Most common:
     SqlConnection and OleDbConnection
     SqlDataAdapter and OleDbAdapter
     DataSet
     DataTable
     SqlDataReader and OleDbDataReader
• Provide a means for accessing data in database



               Learn More @ http://www.learnnowonline.com
                  Copyright © by Application Developers Training Company
Generic Data Objects vs. Entity
• ADO.NET has long had generic data objects
• Most common:
     SqlConnection and OleDbConnection
     SqlDataAdapter and OleDbAdapter
     DataSet
     DataTable
     SqlDataReader and OleDbDataReader
• Provide a means for accessing data in database
   DataSet and DataTable contain rows and columns


               Learn More @ http://www.learnnowonline.com
                  Copyright © by Application Developers Training Company
Generic Data Objects




         Learn More @ http://www.learnnowonline.com
            Copyright © by Application Developers Training Company
Generic Data Objects
• Problems with Generic Data Objects




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Generic Data Objects
• Problems with Generic Data Objects
   Strong coupling between application and database




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Generic Data Objects
• Problems with Generic Data Objects
   Strong coupling between application and database
   Loose typing




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Generic Data Objects
• Problems with Generic Data Objects
   Strong coupling between application and database
   Loose typing
   Object interactions




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Generic Data Objects
• Problems with Generic Data Objects
   Strong coupling between application and database
   Loose typing
   Object interactions
• Problems persist despite long use




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Generic Data Objects
• Problems with Generic Data Objects
   Strong coupling between application and database
   Loose typing
   Object interactions
• Problems persist despite long use
   Every application has to deal with them




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Generic Data Objects
• Problems with Generic Data Objects
   Strong coupling between application and database
   Loose typing
   Object interactions
• Problems persist despite long use
   Every application has to deal with them
   But it’s been the best we’ve had, other than custom
    objects




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Entity Data Objects




         Learn More @ http://www.learnnowonline.com
            Copyright © by Application Developers Training Company
Entity Data Objects
• Big improvement over what came before




            Learn More @ http://www.learnnowonline.com
               Copyright © by Application Developers Training Company
Entity Data Objects
• Big improvement over what came before
   Instead of using a generic DataSet, use Customer,
    Order, and OrderDetail




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Entity Data Objects
• Big improvement over what came before
   Instead of using a generic DataSet, use Customer,
    Order, and OrderDetail
   Navigation properties to access related data




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Entity Data Objects
• Big improvement over what came before
   Instead of using a generic DataSet, use Customer,
    Order, and OrderDetail
   Navigation properties to access related data
   Fit into object-oriented application




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Entity Data Objects
• Big improvement over what came before
   Instead of using a generic DataSet, use Customer,
    Order, and OrderDetail
   Navigation properties to access related data
   Fit into object-oriented application
• Object interfaces can mirror tables and fields




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Entity Data Objects
• Big improvement over what came before
   Instead of using a generic DataSet, use Customer,
    Order, and OrderDetail
   Navigation properties to access related data
   Fit into object-oriented application
• Object interfaces can mirror tables and fields
   Or be completely different




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Entity Data Objects
• Big improvement over what came before
   Instead of using a generic DataSet, use Customer,
    Order, and OrderDetail
   Navigation properties to access related data
   Fit into object-oriented application
• Object interfaces can mirror tables and fields
   Or be completely different
   Or something in between




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Entity Data Objects
• Big improvement over what came before
   Instead of using a generic DataSet, use Customer,
    Order, and OrderDetail
   Navigation properties to access related data
   Fit into object-oriented application
• Object interfaces can mirror tables and fields
   Or be completely different
   Or something in between
• Need a way to map objects to database


              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Benefits of Entity Data Objects




          Learn More @ http://www.learnnowonline.com
             Copyright © by Application Developers Training Company
Benefits of Entity Data Objects
• Strong typing




             Learn More @ http://www.learnnowonline.com
                  Copyright © by Application Developers Training Company
Benefits of Entity Data Objects
• Strong typing
• Compile-time checking




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Benefits of Entity Data Objects
• Strong typing
• Compile-time checking
• Persistence ignorance




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Benefits of Entity Data Objects
•   Strong typing
•   Compile-time checking
•   Persistence ignorance
•   Productivity




               Learn More @ http://www.learnnowonline.com
                  Copyright © by Application Developers Training Company
Data Programming Against a Model




        Learn More @ http://www.learnnowonline.com
           Copyright © by Application Developers Training Company
Data Programming Against a Model
• Will have to change how you think about data in
  an application




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Data Programming Against a Model
• Will have to change how you think about data in
  an application
   No longer interacting directly with the database




               Learn More @ http://www.learnnowonline.com
                  Copyright © by Application Developers Training Company
Data Programming Against a Model
• Will have to change how you think about data in
  an application
   No longer interacting directly with the database
   Instead working with objects




               Learn More @ http://www.learnnowonline.com
                  Copyright © by Application Developers Training Company
Data Programming Against a Model
• Will have to change how you think about data in
  an application
   No longer interacting directly with the database
   Instead working with objects
   Very different paradigms




               Learn More @ http://www.learnnowonline.com
                  Copyright © by Application Developers Training Company
Data Programming Against a Model
• Will have to change how you think about data in
  an application
   No longer interacting directly with the database
   Instead working with objects
   Very different paradigms
• The model is not the database!




               Learn More @ http://www.learnnowonline.com
                  Copyright © by Application Developers Training Company
Data Programming Against a Model
• Will have to change how you think about data in
  an application
   No longer interacting directly with the database
   Instead working with objects
   Very different paradigms
• The model is not the database!
• Generic data objects require lots of code




               Learn More @ http://www.learnnowonline.com
                  Copyright © by Application Developers Training Company
Data Programming Against a Model
• Will have to change how you think about data in
  an application
   No longer interacting directly with the database
   Instead working with objects
   Very different paradigms
• The model is not the database!
• Generic data objects require lots of code
• Entity data objects mean querying a schema that
  reflects business model

               Learn More @ http://www.learnnowonline.com
                  Copyright © by Application Developers Training Company
Data Programming Against a Model
• Will have to change how you think about data in
  an application
   No longer interacting directly with the database
   Instead working with objects
   Very different paradigms
• The model is not the database!
• Generic data objects require lots of code
• Entity data objects mean querying a schema that
  reflects business model
• ORM eliminates context shift in code
               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
• Object-Relational Mapping (ORM) and Data
  Access




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Agenda
• Object-Relational Mapping (ORM) and Data
  Access
• The Entity Framework and Data Model




            Learn More @ http://www.learnnowonline.com
               Copyright © by Application Developers Training Company
Agenda
• Object-Relational Mapping (ORM) and Data
  Access
• The Entity Framework and Data Model
• Building a Simple Application using Entity
  Framework




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Agenda
• Object-Relational Mapping (ORM) and Data
  Access
• The Entity Framework and Data Model
• Building a Simple Application using Entity
  Framework
• Entity Framework APIs and Tools




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
The Entity Framework and Data
Model




         Learn More @ http://www.learnnowonline.com
            Copyright © by Application Developers Training Company
The Entity Framework and Data
Model
• Complete ORM for .NET applications




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
The Entity Framework and Data
Model
• Complete ORM for .NET applications
• Microsoft’s new core data access technology




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
The Entity Framework and Data
Model
• Complete ORM for .NET applications
• Microsoft’s new core data access technology
   Big commitment from the company




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
The Entity Framework and Data
Model
• Complete ORM for .NET applications
• Microsoft’s new core data access technology
    Big commitment from the company
• Initial release didn’t gain much traction




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
The Entity Framework and Data
Model
• Complete ORM for .NET applications
• Microsoft’s new core data access technology
    Big commitment from the company
• Initial release didn’t gain much traction
• Version 4.1 is a mature product




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
The Entity Framework and Data
Model
• Complete ORM for .NET applications
• Microsoft’s new core data access technology
    Big commitment from the company
• Initial release didn’t gain much traction
• Version 4.1 is a mature product
    Substantial commitment and innovation




               Learn More @ http://www.learnnowonline.com
                  Copyright © by Application Developers Training Company
The Entity Framework and Data
Model
• Complete ORM for .NET applications
• Microsoft’s new core data access technology
    Big commitment from the company
• Initial release didn’t gain much traction
• Version 4.1 is a mature product
    Substantial commitment and innovation
• Do we need a new data access technology?



               Learn More @ http://www.learnnowonline.com
                  Copyright © by Application Developers Training Company
The Entity Framework and Data
Model
• Complete ORM for .NET applications
• Microsoft’s new core data access technology
    Big commitment from the company
• Initial release didn’t gain much traction
• Version 4.1 is a mature product
    Substantial commitment and innovation
• Do we need a new data access technology?
    Older technologies have run their course



               Learn More @ http://www.learnnowonline.com
                  Copyright © by Application Developers Training Company
The Entity Framework and Data
Model
• Complete ORM for .NET applications
• Microsoft’s new core data access technology
    Big commitment from the company
• Initial release didn’t gain much traction
• Version 4.1 is a mature product
    Substantial commitment and innovation
• Do we need a new data access technology?
    Older technologies have run their course
    Modern applications have to focus on domain model

               Learn More @ http://www.learnnowonline.com
                  Copyright © by Application Developers Training Company
The Entity Framework and Data
Model
• Complete ORM for .NET applications
• Microsoft’s new core data access technology
    Big commitment from the company
• Initial release didn’t gain much traction
• Version 4.1 is a mature product
    Substantial commitment and innovation
• Do we need a new data access technology?
    Older technologies have run their course
    Modern applications have to focus on domain model
• Version numbers
               Learn More @ http://www.learnnowonline.com
                  Copyright © by Application Developers Training Company
Entity Data Model




       Learn More @ http://www.learnnowonline.com
          Copyright © by Application Developers Training Company
Entity Data Model
• Integral part of Entity Framework




           Learn More @ http://www.learnnowonline.com
              Copyright © by Application Developers Training Company
Entity Data Model
• Integral part of Entity Framework
• Client-side model different from database schema




           Learn More @ http://www.learnnowonline.com
              Copyright © by Application Developers Training Company
Entity Data Model
• Integral part of Entity Framework
• Client-side model different from database schema
• Describes structure of entity data objects




           Learn More @ http://www.learnnowonline.com
              Copyright © by Application Developers Training Company
Entity Data Model
•   Integral part of Entity Framework
•   Client-side model different from database schema
•   Describes structure of entity data objects
•   Take the database schema and reshape it into
    objects




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Entity Data Model
• Integral part of Entity Framework
• Client-side model different from database schema
• Describes structure of entity data objects
• Take the database schema and reshape it into
  objects
• Defined by three chunks of XML in a single .edmx
  file




           Learn More @ http://www.learnnowonline.com
              Copyright © by Application Developers Training Company
Entity Data Model
• Integral part of Entity Framework
• Client-side model different from database schema
• Describes structure of entity data objects
• Take the database schema and reshape it into
  objects
• Defined by three chunks of XML in a single .edmx
  file
     Conceptual model




            Learn More @ http://www.learnnowonline.com
               Copyright © by Application Developers Training Company
Entity Data Model
• Integral part of Entity Framework
• Client-side model different from database schema
• Describes structure of entity data objects
• Take the database schema and reshape it into
  objects
• Defined by three chunks of XML in a single .edmx
  file
     Conceptual model
     Storage model


            Learn More @ http://www.learnnowonline.com
               Copyright © by Application Developers Training Company
Entity Data Model
• Integral part of Entity Framework
• Client-side model different from database schema
• Describes structure of entity data objects
• Take the database schema and reshape it into
  objects
• Defined by three chunks of XML in a single .edmx
  file
     Conceptual model
     Storage model
     Mapping

            Learn More @ http://www.learnnowonline.com
               Copyright © by Application Developers Training Company
LINQ to SQL




        Learn More @ http://www.learnnowonline.com
           Copyright © by Application Developers Training Company
LINQ to SQL
• Similar to Entity Framework




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
LINQ to SQL
• Similar to Entity Framework
   Both use LINQ to query a database using a data
    model




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
LINQ to SQL
• Similar to Entity Framework
   Both use LINQ to query a database using a data
    model
• Developed independently at Microsoft




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
LINQ to SQL
• Similar to Entity Framework
   Both use LINQ to query a database using a data
    model
• Developed independently at Microsoft
   LINQ to SQL grew out of LINQ team




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
LINQ to SQL
• Similar to Entity Framework
   Both use LINQ to query a database using a data
    model
• Developed independently at Microsoft
   LINQ to SQL grew out of LINQ team
   Entity Framework grew out of Data Programmability
    team




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
LINQ to SQL
• Similar to Entity Framework
   Both use LINQ to query a database using a data
    model
• Developed independently at Microsoft
   LINQ to SQL grew out of LINQ team
   Entity Framework grew out of Data Programmability
    team
• Soon Microsoft had two new data access
  technologies


              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
LINQ to SQL
• Similar to Entity Framework
   Both use LINQ to query a database using a data
    model
• Developed independently at Microsoft
   LINQ to SQL grew out of LINQ team
   Entity Framework grew out of Data Programmability
    team
• Soon Microsoft had two new data access
  technologies
• LINQ to SQL moved, and lost out to Entity
  Framework
              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Why Use Entity Framework?




        Learn More @ http://www.learnnowonline.com
           Copyright © by Application Developers Training Company
Why Use Entity Framework?
• Part of the .NET Framework and integrated into
  Visual Studio




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Why Use Entity Framework?
• Part of the .NET Framework and integrated into
  Visual Studio
• Uses LINQ as the primary query language




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Why Use Entity Framework?
• Part of the .NET Framework and integrated into
  Visual Studio
• Uses LINQ as the primary query language
• Independent of the data source




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Why Use Entity Framework?
• Part of the .NET Framework and integrated into
  Visual Studio
• Uses LINQ as the primary query language
• Independent of the data source
• Microsoft’s primary data access strategy




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
When Should You Not Use Entity
Framework or an ORM?




         Learn More @ http://www.learnnowonline.com
            Copyright © by Application Developers Training Company
When Should You Not Use Entity
Framework or an ORM?
• Entity Framework is not a panacea




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
When Should You Not Use Entity
Framework or an ORM?
• Entity Framework is not a panacea
   Not an instant data access panacea




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
When Should You Not Use Entity
Framework or an ORM?
• Entity Framework is not a panacea
   Not an instant data access panacea
   Isn’t appropriate for every kind of application




               Learn More @ http://www.learnnowonline.com
                  Copyright © by Application Developers Training Company
When Should You Not Use Entity
Framework or an ORM?
• Entity Framework is not a panacea
   Not an instant data access panacea
   Isn’t appropriate for every kind of application
   Doesn’t do bulk inserts




               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
• Object-Relational Mapping (ORM) and Data
  Access




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Agenda
• Object-Relational Mapping (ORM) and Data
  Access
• The Entity Framework and Data Model




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Agenda
• Object-Relational Mapping (ORM) and Data
  Access
• The Entity Framework and Data Model
• Building a Simple Application using Entity
  Framework




            Learn More @ http://www.learnnowonline.com
               Copyright © by Application Developers Training Company
Agenda
• Object-Relational Mapping (ORM) and Data
  Access
• The Entity Framework and Data Model
• Building a Simple Application using Entity
  Framework
• Entity Framework APIs and Tools




            Learn More @ http://www.learnnowonline.com
               Copyright © by Application Developers Training Company
Building a Simple Application using
Entity Framework




          Learn More @ http://www.learnnowonline.com
             Copyright © by Application Developers Training Company
Building a Simple Application using
Entity Framework
• Compelling reason to use Entity Framework is its
  integration with Visual Studio




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Building a Simple Application using
Entity Framework
• Compelling reason to use Entity Framework is its
  integration with Visual Studio
• Sample is based on AdventureWorksLT




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Building a Simple Application using
Entity Framework
• Compelling reason to use Entity Framework is its
  integration with Visual Studio
• Sample is based on AdventureWorksLT
   Ten tables with data about customers, products, and
    orders




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Building a Simple Application using
Entity Framework
• Compelling reason to use Entity Framework is its
  integration with Visual Studio
• Sample is based on AdventureWorksLT
   Ten tables with data about customers, products, and
    orders
   Complex enough to exercise Entity Framework




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Building a Simple Application using
Entity Framework
• Compelling reason to use Entity Framework is its
  integration with Visual Studio
• Sample is based on AdventureWorksLT
    Ten tables with data about customers, products, and
     orders
    Complex enough to exercise Entity Framework
• Will build sample as a class library




               Learn More @ http://www.learnnowonline.com
                  Copyright © by Application Developers Training Company
Building a Simple Application using
Entity Framework
• Compelling reason to use Entity Framework is its
  integration with Visual Studio
• Sample is based on AdventureWorksLT
    Ten tables with data about customers, products, and
     orders
    Complex enough to exercise Entity Framework
• Will build sample as a class library
    Easy to reuse in multiple applications




                Learn More @ http://www.learnnowonline.com
                   Copyright © by Application Developers Training Company
Building a Simple Application using
Entity Framework
• Compelling reason to use Entity Framework is its
  integration with Visual Studio
• Sample is based on AdventureWorksLT
    Ten tables with data about customers, products, and
     orders
    Complex enough to exercise Entity Framework
• Will build sample as a class library
    Easy to reuse in multiple applications
    Not absolutely necessary


                Learn More @ http://www.learnnowonline.com
                   Copyright © by Application Developers Training Company
Building a Simple Application using
Entity Framework
• Compelling reason to use Entity Framework is its
  integration with Visual Studio
• Sample is based on AdventureWorksLT
    Ten tables with data about customers, products, and
     orders
    Complex enough to exercise Entity Framework
• Will build sample as a class library
    Easy to reuse in multiple applications
    Not absolutely necessary
• Mostly create simple console applications
                Learn More @ http://www.learnnowonline.com
                   Copyright © by Application Developers Training Company
Using the Entity Objects




         Learn More @ http://www.learnnowonline.com
            Copyright © by Application Developers Training Company
Using the Entity Objects
• Time to use the entity data objects in an
  application




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Using the Entity Objects
• Time to use the entity data objects in an
  application
• Simple console application




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Using the Entity Objects
• Time to use the entity data objects in an
  application
• Simple console application
• Need to do three things to use the class library




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Using the Entity Objects
• Time to use the entity data objects in an
  application
• Simple console application
• Need to do three things to use the class library
   Add a reference to the class library




               Learn More @ http://www.learnnowonline.com
                  Copyright © by Application Developers Training Company
Using the Entity Objects
• Time to use the entity data objects in an
  application
• Simple console application
• Need to do three things to use the class library
   Add a reference to the class library
   Add a reference to System.Data.Entity




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Using the Entity Objects
• Time to use the entity data objects in an
  application
• Simple console application
• Need to do three things to use the class library
   Add a reference to the class library
   Add a reference to System.Data.Entity
   Add the Entity Framework connection string




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Using the Entity Objects
• Time to use the entity data objects in an
  application
• Simple console application
• Need to do three things to use the class library
   Add a reference to the class library
   Add a reference to System.Data.Entity
   Add the Entity Framework connection string
• And, of course, write some code!


              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
• Object-Relational Mapping (ORM) and Data
  Access




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Agenda
• Object-Relational Mapping (ORM) and Data
  Access
• The Entity Framework and Data Model




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Agenda
• Object-Relational Mapping (ORM) and Data
  Access
• The Entity Framework and Data Model
• Building a Simple Application using Entity
  Framework




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Agenda
• Object-Relational Mapping (ORM) and Data
  Access
• The Entity Framework and Data Model
• Building a Simple Application using Entity
  Framework
• Entity Framework APIs and Tools




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Entity Framework APIs and Tools




         Learn More @ http://www.learnnowonline.com
            Copyright © by Application Developers Training Company
Entity Framework APIs and Tools
• Entity Framework is a complex set of APIs and
  design tools




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Entity Framework APIs and Tools
• Entity Framework is a complex set of APIs and
  design tools
• Need a basic understanding of what each of the
  Entity Framework components do




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Entity Framework APIs and Tools
• Entity Framework is a complex set of APIs and
  design tools
• Need a basic understanding of what each of the
  Entity Framework components do
   Road to deep understanding




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Architecture




          Learn More @ http://www.learnnowonline.com
             Copyright © by Application Developers Training Company
Application
Architecture




          Learn More @ http://www.learnnowonline.com
             Copyright © by Application Developers Training Company
Application
Architecture                                    Entity
                                                 SQL
                                                                      LINQ to
                                                                      Entities
                                                Query                  Query




          Learn More @ http://www.learnnowonline.com
             Copyright © by Application Developers Training Company
Application
Architecture                                    Entity
                                                 SQL
                                                                      LINQ to
                                                                      Entities
                                                Query                  Query



                                                              Object Services




          Learn More @ http://www.learnnowonline.com
             Copyright © by Application Developers Training Company
Application
Architecture                                    Entity
                                                 SQL
                                                                      LINQ to
                                                                      Entities
                                                Query                  Query
                                                                                 Results

                                                              Object Services




          Learn More @ http://www.learnnowonline.com
             Copyright © by Application Developers Training Company
Application
Architecture                                    Entity
                                                 SQL
                                                                      LINQ to
                                                                      Entities
                                                Query                  Query
                                                                                 Results

                                                              Object Services

                                                                 Command
                                                                   Tree




          Learn More @ http://www.learnnowonline.com
             Copyright © by Application Developers Training Company
Application
Architecture                                    Entity
                                                 SQL
                                                                      LINQ to
                                                                      Entities
                                                Query                  Query
                                                                                 Results

                                                              Object Services

                                                                 Command
                                                                   Tree


                                            EntityClient Data Provider




          Learn More @ http://www.learnnowonline.com
             Copyright © by Application Developers Training Company
Application
Architecture                                    Entity
                                                 SQL
                                                                      LINQ to
                                                                      Entities
                                                Query                  Query
                                                                                 Results

                                                              Object Services

                                                                 Command
                                                                                 Entity
                                                                   Tree
                                                                                  Data
                                                                                 Reader

                                            EntityClient Data Provider




          Learn More @ http://www.learnnowonline.com
             Copyright © by Application Developers Training Company
Application
Architecture                                    Entity
                                                 SQL
                                                                      LINQ to
                                                                      Entities
                                                Query                  Query
                                                                                 Results
                             Entity
                              SQL
                             Query                            Object Services

                                                                 Command
                                                                                 Entity
                                                                   Tree
                                                                                  Data
                                                                                 Reader

                                            EntityClient Data Provider




          Learn More @ http://www.learnnowonline.com
             Copyright © by Application Developers Training Company
Application
Architecture                                    Entity
                                                 SQL
                                                                      LINQ to
                                                                      Entities
                                                Query                  Query
                                                                                 Results
                             Entity
                              SQL
                             Query                            Object Services

                                                                 Command
                                                                                 Entity
                                                                   Tree
                                                                                  Data
                                                                                 Reader

                                            EntityClient Data Provider

                                                                 Command
                                                                   Tree




          Learn More @ http://www.learnnowonline.com
             Copyright © by Application Developers Training Company
Application
Architecture                                    Entity
                                                 SQL
                                                                      LINQ to
                                                                      Entities
                                                Query                  Query
                                                                                 Results
                             Entity
                              SQL
                             Query                            Object Services

                                                                 Command
                                                                                 Entity
                                                                   Tree
                                                                                  Data
                                                                                 Reader

                                            EntityClient Data Provider

                                                                 Command
                                                                   Tree


                                              ADO.NET Data Providers




          Learn More @ http://www.learnnowonline.com
             Copyright © by Application Developers Training Company
Application
Architecture                                    Entity
                                                 SQL
                                                                      LINQ to
                                                                      Entities
                                                Query                  Query
                                                                                 Results
                             Entity
                              SQL
                             Query                            Object Services

                                                                 Command
                                                                                 Entity
                                                                   Tree
                                                                                  Data
                                                                                 Reader

                                            EntityClient Data Provider

                                                                 Command
                                                                   Tree          DB Data
                                                                                 Reader

                                              ADO.NET Data Providers




          Learn More @ http://www.learnnowonline.com
             Copyright © by Application Developers Training Company
Application
Architecture                                    Entity
                                                 SQL
                                                                      LINQ to
                                                                      Entities
                                                Query                  Query
                                                                                 Results
                             Entity
                              SQL
                             Query                            Object Services

                                                                 Command
                                                                                 Entity
                                                                   Tree
                                                                                  Data
                                                                                 Reader

                                            EntityClient Data Provider

                                                                 Command
                                                                   Tree          DB Data
                                                                                 Reader

                                              ADO.NET Data Providers



                                                         Data Store
          Learn More @ http://www.learnnowonline.com
             Copyright © by Application Developers Training Company
Application
Architecture                                          Entity
                                                       SQL
                                                                            LINQ to
                                                                            Entities
                                                      Query                  Query
     Entity Data                                                                       Results
                                   Entity
       Model                        SQL
                                   Query                            Object Services

                                                                       Command
                                                                                       Entity
                                                                         Tree
                                                                                        Data
                                                                                       Reader

                                                  EntityClient Data Provider

                                                                       Command
                                                                         Tree          DB Data
                                                                                       Reader

                                                    ADO.NET Data Providers



                                                               Data Store
               Learn More @ http://www.learnnowonline.com
                   Copyright © by Application Developers Training Company
Application
Architecture                                          Entity
                                                       SQL
                                                                            LINQ to
                                                                            Entities
                                                      Query                  Query
     Entity Data                                                                       Results
                                   Entity
       Model                        SQL
                                   Query                            Object Services
     Conceptual
       Model                                                           Command
                                                                                       Entity
                                                                         Tree
                                                                                        Data
                                                                                       Reader

                                                  EntityClient Data Provider

                                                                       Command
                                                                         Tree          DB Data
                                                                                       Reader

                                                    ADO.NET Data Providers



                                                               Data Store
               Learn More @ http://www.learnnowonline.com
                   Copyright © by Application Developers Training Company
Application
Architecture                                          Entity
                                                       SQL
                                                                            LINQ to
                                                                            Entities
                                                      Query                  Query
     Entity Data                                                                       Results
                                   Entity
       Model                        SQL
                                   Query                            Object Services
     Conceptual
       Model                                                           Command
                                                                                       Entity
                                                                         Tree
                                                                                        Data
                                                                                       Reader

                                                  EntityClient Data Provider

                                                                       Command
                                                                         Tree          DB Data
      Storage                                                                          Reader
       Model
                                                    ADO.NET Data Providers



                                                               Data Store
                Learn More @ http://www.learnnowonline.com
                   Copyright © by Application Developers Training Company
Application
Architecture                                             Entity
                                                          SQL
                                                                               LINQ to
                                                                               Entities
                                                         Query                  Query
     Entity Data                                                                          Results
                                      Entity
       Model                           SQL
                                      Query                            Object Services
     Conceptual
       Model                                                              Command
                                                                                          Entity
                                                                            Tree
                                                                                           Data
                                                                                          Reader
         Mapping




                                                     EntityClient Data Provider

                                                                          Command
                                                                            Tree          DB Data
      Storage                                                                             Reader
       Model
                                                       ADO.NET Data Providers



                                                                  Data Store
                   Learn More @ http://www.learnnowonline.com
                      Copyright © by Application Developers Training Company
Entity Data Model Designer




         Learn More @ http://www.learnnowonline.com
            Copyright © by Application Developers Training Company
Entity Data Model Designer
• Part of Visual Studio




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Entity Data Model Designer
• Part of Visual Studio
• Lets you work with model graphically rather than
  as raw XML




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Entity Data Model Designer
• Part of Visual Studio
• Lets you work with model graphically rather than
  as raw XML
• First saw as part of the AdventureWorksLibrary
  project




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Entity Data Model Designer
• Part of Visual Studio
• Lets you work with model graphically rather than
  as raw XML
• First saw as part of the AdventureWorksLibrary
  project
• Doesn’t support all Entity Data Model features




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Entity Data Model Designer
• Part of Visual Studio
• Lets you work with model graphically rather than
  as raw XML
• First saw as part of the AdventureWorksLibrary
  project
• Doesn’t support all Entity Data Model features
• Lets you map tables, views, stored procedures
  and functions to entities


             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Entity Data Model Designer
• Part of Visual Studio
• Lets you work with model graphically rather than
  as raw XML
• First saw as part of the AdventureWorksLibrary
  project
• Doesn’t support all Entity Data Model features
• Lets you map tables, views, stored procedures
  and functions to entities
   Can update the model from the underlying database

              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Design Methodologies Using the
Designer




         Learn More @ http://www.learnnowonline.com
            Copyright © by Application Developers Training Company
Design Methodologies Using the
Designer
• Two broad ways to build a data application




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Design Methodologies Using the
Designer
• Two broad ways to build a data application
   Top-down design




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Design Methodologies Using the
Designer
• Two broad ways to build a data application
   Top-down design
   Bottom-up design




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Design Methodologies Using the
Designer
• Two broad ways to build a data application
   Top-down design
   Bottom-up design
• Neither is necessarily better than the other




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Design Methodologies Using the
Designer
• Two broad ways to build a data application
   Top-down design
   Bottom-up design
• Neither is necessarily better than the other
• Entity Framework supports both




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Design Methodologies Using the
Designer
• Two broad ways to build a data application
   Top-down design
   Bottom-up design
• Neither is necessarily better than the other
• Entity Framework supports both
• Provides three ways to build an application




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Design Methodologies Using the
Designer
• Two broad ways to build a data application
   Top-down design
   Bottom-up design
• Neither is necessarily better than the other
• Entity Framework supports both
• Provides three ways to build an application
   Database-first design




              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Design Methodologies Using the
Designer
• Two broad ways to build a data application
   Top-down design
   Bottom-up design
• Neither is necessarily better than the other
• Entity Framework supports both
• Provides three ways to build an application
   Database-first design
   Model-first design



              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Design Methodologies Using the
Designer
• Two broad ways to build a data application
   Top-down design
   Bottom-up design
• Neither is necessarily better than the other
• Entity Framework supports both
• Provides three ways to build an application
   Database-first design
   Model-first design
   Code-first design


              Learn More @ http://www.learnnowonline.com
                 Copyright © by Application Developers Training Company
Code Generation Using T4




         Learn More @ http://www.learnnowonline.com
            Copyright © by Application Developers Training Company
Code Generation Using T4
• Entity Data Model designer generates code




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Code Generation Using T4
• Entity Data Model designer generates code
• Uses Visual Studio’s Text Template
  Transformation Toolkit (T4)




             Learn More @ http://www.learnnowonline.com
                Copyright © by Application Developers Training Company
Code Generation Using T4
• Entity Data Model designer generates code
• Uses Visual Studio’s Text Template
  Transformation Toolkit (T4)
   Generates classes in designer code file




               Learn More @ http://www.learnnowonline.com
                  Copyright © by Application Developers Training Company
Introducing the Entity Framework
Introducing the Entity Framework
Introducing the Entity Framework
Introducing the Entity Framework
Introducing the Entity Framework
Introducing the Entity Framework
Introducing the Entity Framework
Introducing the Entity Framework
Introducing the Entity Framework
Introducing the Entity Framework
Introducing the Entity Framework
Introducing the Entity Framework
Introducing the Entity Framework
Introducing the Entity Framework
Introducing the Entity Framework
Introducing the Entity Framework
Introducing the Entity Framework
Introducing the Entity Framework
Introducing the Entity Framework
Introducing the Entity Framework
Introducing the Entity Framework
Introducing the Entity Framework
Introducing the Entity Framework
Introducing the Entity Framework
Introducing the Entity Framework
Introducing the Entity Framework
Introducing the Entity Framework
Introducing the Entity Framework
Introducing the Entity Framework
Introducing the Entity Framework
Introducing the Entity Framework
Introducing the Entity Framework
Introducing the Entity Framework
Introducing the Entity Framework
Introducing the Entity Framework
Introducing the Entity Framework

More Related Content

What's hot

Entity Framework Database and Code First
Entity Framework Database and Code FirstEntity Framework Database and Code First
Entity Framework Database and Code FirstJames Johnson
 
Entity framework and how to use it
Entity framework and how to use itEntity framework and how to use it
Entity framework and how to use itnspyre_net
 
Entity framework
Entity frameworkEntity framework
Entity frameworkicubesystem
 
Entity Framework - Queries
Entity Framework -  QueriesEntity Framework -  Queries
Entity Framework - QueriesEyal Vardi
 
ADO.NET Entity Framework
ADO.NET Entity FrameworkADO.NET Entity Framework
ADO.NET Entity FrameworkDoncho Minkov
 
Entity framework 4.0
Entity framework 4.0Entity framework 4.0
Entity framework 4.0Abhishek Sur
 
Entity Framework - Object Services
Entity Framework -  Object ServicesEntity Framework -  Object Services
Entity Framework - Object ServicesEyal Vardi
 
ADO.NET Entity Framework
ADO.NET Entity FrameworkADO.NET Entity Framework
ADO.NET Entity Frameworkukdpe
 
Building nTier Applications with Entity Framework Services
Building nTier Applications with Entity Framework ServicesBuilding nTier Applications with Entity Framework Services
Building nTier Applications with Entity Framework ServicesDavid McCarter
 
Entity Framework v2 Best Practices
Entity Framework v2 Best PracticesEntity Framework v2 Best Practices
Entity Framework v2 Best PracticesAndri Yadi
 
Lerman Vvs14 Ef Tips And Tricks
Lerman Vvs14  Ef Tips And TricksLerman Vvs14  Ef Tips And Tricks
Lerman Vvs14 Ef Tips And TricksJulie Lerman
 
LINQ to Relational in Visual Studio 2008 SP1
LINQ to Relational in Visual Studio 2008 SP1LINQ to Relational in Visual Studio 2008 SP1
LINQ to Relational in Visual Studio 2008 SP1ukdpe
 
Microsoft Entity Framework
Microsoft Entity FrameworkMicrosoft Entity Framework
Microsoft Entity FrameworkMahmoud Tolba
 
Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)David McCarter
 
Building nTier Applications with Entity Framework Services (Part 2)
Building nTier Applications with Entity Framework Services (Part 2)Building nTier Applications with Entity Framework Services (Part 2)
Building nTier Applications with Entity Framework Services (Part 2)David McCarter
 
Back-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real WorldBack-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real WorldDavid McCarter
 

What's hot (20)

Getting started with entity framework
Getting started with entity framework Getting started with entity framework
Getting started with entity framework
 
Entity Framework Database and Code First
Entity Framework Database and Code FirstEntity Framework Database and Code First
Entity Framework Database and Code First
 
Entity framework and how to use it
Entity framework and how to use itEntity framework and how to use it
Entity framework and how to use it
 
Entity framework
Entity frameworkEntity framework
Entity framework
 
Entity Framework - Queries
Entity Framework -  QueriesEntity Framework -  Queries
Entity Framework - Queries
 
ADO.NET Entity Framework
ADO.NET Entity FrameworkADO.NET Entity Framework
ADO.NET Entity Framework
 
Entity framework 4.0
Entity framework 4.0Entity framework 4.0
Entity framework 4.0
 
Entity Framework - Object Services
Entity Framework -  Object ServicesEntity Framework -  Object Services
Entity Framework - Object Services
 
ADO.NET Entity Framework
ADO.NET Entity FrameworkADO.NET Entity Framework
ADO.NET Entity Framework
 
Building nTier Applications with Entity Framework Services
Building nTier Applications with Entity Framework ServicesBuilding nTier Applications with Entity Framework Services
Building nTier Applications with Entity Framework Services
 
Entity Framework v2 Best Practices
Entity Framework v2 Best PracticesEntity Framework v2 Best Practices
Entity Framework v2 Best Practices
 
Lerman Vvs14 Ef Tips And Tricks
Lerman Vvs14  Ef Tips And TricksLerman Vvs14  Ef Tips And Tricks
Lerman Vvs14 Ef Tips And Tricks
 
LINQ to Relational in Visual Studio 2008 SP1
LINQ to Relational in Visual Studio 2008 SP1LINQ to Relational in Visual Studio 2008 SP1
LINQ to Relational in Visual Studio 2008 SP1
 
Microsoft Entity Framework
Microsoft Entity FrameworkMicrosoft Entity Framework
Microsoft Entity Framework
 
Entity framework
Entity frameworkEntity framework
Entity framework
 
Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)
 
Building nTier Applications with Entity Framework Services (Part 2)
Building nTier Applications with Entity Framework Services (Part 2)Building nTier Applications with Entity Framework Services (Part 2)
Building nTier Applications with Entity Framework Services (Part 2)
 
Talend preso (1)
Talend preso (1)Talend preso (1)
Talend preso (1)
 
LINQ in C#
LINQ in C#LINQ in C#
LINQ in C#
 
Back-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real WorldBack-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real World
 

Viewers also liked

Allianz Arena car park coating
Allianz Arena car park coatingAllianz Arena car park coating
Allianz Arena car park coatingDaniela Lutz
 
PPT Finalized
PPT FinalizedPPT Finalized
PPT FinalizedYige Wu
 
Diapositivas de los objetivos estrategicos
Diapositivas de los objetivos estrategicosDiapositivas de los objetivos estrategicos
Diapositivas de los objetivos estrategicosAlexandra Becerra
 
The 8 do’s and don’ts of graph visualisations.
The 8 do’s and don’ts of graph visualisations.The 8 do’s and don’ts of graph visualisations.
The 8 do’s and don’ts of graph visualisations.Connected Data World
 
Prof. Hendrik Speck - Attention Based Economies - the Economic Value of Googl...
Prof. Hendrik Speck - Attention Based Economies - the Economic Value of Googl...Prof. Hendrik Speck - Attention Based Economies - the Economic Value of Googl...
Prof. Hendrik Speck - Attention Based Economies - the Economic Value of Googl...Hendrik Speck
 
Finding the structures of Boron Nitride Atomic clusters
Finding the structures of Boron Nitride Atomic clustersFinding the structures of Boron Nitride Atomic clusters
Finding the structures of Boron Nitride Atomic clustersMark Appleton
 
LAS RELACIONES PÚBLICAS Y SU CAMPO DE ACCIÓN
LAS RELACIONES PÚBLICAS Y SU CAMPO DE ACCIÓNLAS RELACIONES PÚBLICAS Y SU CAMPO DE ACCIÓN
LAS RELACIONES PÚBLICAS Y SU CAMPO DE ACCIÓNMariamirgrey09
 
Luteal phase support in art - revisited
Luteal phase support in art  - revisitedLuteal phase support in art  - revisited
Luteal phase support in art - revisitedLifecare Centre
 
1. Insuline and Anti diabetics
1. Insuline and Anti diabetics1. Insuline and Anti diabetics
1. Insuline and Anti diabeticsMirza Anwar Baig
 
5th Qatar BIM User Day, BIM Interoperability Issues: Lessons learned from PLM
5th Qatar BIM User Day, BIM Interoperability Issues: Lessons learned from PLM5th Qatar BIM User Day, BIM Interoperability Issues: Lessons learned from PLM
5th Qatar BIM User Day, BIM Interoperability Issues: Lessons learned from PLMBIM User Day
 
Luteaal phase support lifecare centre
Luteaal phase support lifecare centreLuteaal phase support lifecare centre
Luteaal phase support lifecare centreLifecare Centre
 
Oracle Forms Tutorial (www.aboutoracleapps.com)
Oracle Forms Tutorial (www.aboutoracleapps.com)Oracle Forms Tutorial (www.aboutoracleapps.com)
Oracle Forms Tutorial (www.aboutoracleapps.com)magupta26
 
Paralegal Outsourcing Services by Legal Support Experts
Paralegal Outsourcing Services by Legal Support ExpertsParalegal Outsourcing Services by Legal Support Experts
Paralegal Outsourcing Services by Legal Support ExpertsCogneesol
 

Viewers also liked (17)

HSBC uses SAS Business analytics
HSBC uses SAS Business analyticsHSBC uses SAS Business analytics
HSBC uses SAS Business analytics
 
Allianz Arena car park coating
Allianz Arena car park coatingAllianz Arena car park coating
Allianz Arena car park coating
 
PPT Finalized
PPT FinalizedPPT Finalized
PPT Finalized
 
Diapositivas de los objetivos estrategicos
Diapositivas de los objetivos estrategicosDiapositivas de los objetivos estrategicos
Diapositivas de los objetivos estrategicos
 
The 8 do’s and don’ts of graph visualisations.
The 8 do’s and don’ts of graph visualisations.The 8 do’s and don’ts of graph visualisations.
The 8 do’s and don’ts of graph visualisations.
 
4.lymphatic system
4.lymphatic system4.lymphatic system
4.lymphatic system
 
Prof. Hendrik Speck - Attention Based Economies - the Economic Value of Googl...
Prof. Hendrik Speck - Attention Based Economies - the Economic Value of Googl...Prof. Hendrik Speck - Attention Based Economies - the Economic Value of Googl...
Prof. Hendrik Speck - Attention Based Economies - the Economic Value of Googl...
 
Finding the structures of Boron Nitride Atomic clusters
Finding the structures of Boron Nitride Atomic clustersFinding the structures of Boron Nitride Atomic clusters
Finding the structures of Boron Nitride Atomic clusters
 
LAS RELACIONES PÚBLICAS Y SU CAMPO DE ACCIÓN
LAS RELACIONES PÚBLICAS Y SU CAMPO DE ACCIÓNLAS RELACIONES PÚBLICAS Y SU CAMPO DE ACCIÓN
LAS RELACIONES PÚBLICAS Y SU CAMPO DE ACCIÓN
 
4. Oral contraceptives
4. Oral contraceptives4. Oral contraceptives
4. Oral contraceptives
 
Luteal phase support in art - revisited
Luteal phase support in art  - revisitedLuteal phase support in art  - revisited
Luteal phase support in art - revisited
 
1. Insuline and Anti diabetics
1. Insuline and Anti diabetics1. Insuline and Anti diabetics
1. Insuline and Anti diabetics
 
5th Qatar BIM User Day, BIM Interoperability Issues: Lessons learned from PLM
5th Qatar BIM User Day, BIM Interoperability Issues: Lessons learned from PLM5th Qatar BIM User Day, BIM Interoperability Issues: Lessons learned from PLM
5th Qatar BIM User Day, BIM Interoperability Issues: Lessons learned from PLM
 
Luteaal phase support lifecare centre
Luteaal phase support lifecare centreLuteaal phase support lifecare centre
Luteaal phase support lifecare centre
 
forms builder
forms builderforms builder
forms builder
 
Oracle Forms Tutorial (www.aboutoracleapps.com)
Oracle Forms Tutorial (www.aboutoracleapps.com)Oracle Forms Tutorial (www.aboutoracleapps.com)
Oracle Forms Tutorial (www.aboutoracleapps.com)
 
Paralegal Outsourcing Services by Legal Support Experts
Paralegal Outsourcing Services by Legal Support ExpertsParalegal Outsourcing Services by Legal Support Experts
Paralegal Outsourcing Services by Legal Support Experts
 

Similar to Introducing the Entity Framework

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
 
Using The .NET Framework
Using The .NET FrameworkUsing The .NET Framework
Using The .NET FrameworkLearnNowOnline
 
What's new in Silverlight 5
What's new in Silverlight 5What's new in Silverlight 5
What's new in Silverlight 5LearnNowOnline
 
Object-Oriented JavaScript
Object-Oriented JavaScriptObject-Oriented JavaScript
Object-Oriented JavaScriptLearnNowOnline
 
Couchbase usage at Symantec
Couchbase usage at SymantecCouchbase usage at Symantec
Couchbase usage at Symantecgauravchandna
 
WPF: Working with Data
WPF: Working with DataWPF: Working with Data
WPF: Working with DataLearnNowOnline
 
O365Con18 - How to Run a Search Project in SharePoint - Matthew McDermott
O365Con18 - How to Run a Search Project in SharePoint -  Matthew McDermottO365Con18 - How to Run a Search Project in SharePoint -  Matthew McDermott
O365Con18 - How to Run a Search Project in SharePoint - Matthew McDermottNCCOMMS
 
Getting Started with .NET
Getting Started with .NETGetting Started with .NET
Getting Started with .NETLearnNowOnline
 
SharePoint Document Management
SharePoint Document ManagementSharePoint Document Management
SharePoint Document ManagementLearnNowOnline
 
.NET Variables and Data Types
.NET Variables and Data Types.NET Variables and Data Types
.NET Variables and Data TypesLearnNowOnline
 
Feature driven agile oriented web applications
Feature driven agile oriented web applicationsFeature driven agile oriented web applications
Feature driven agile oriented web applicationsRam G Athreya
 
Non-Relational Revolution: Database Week SF
Non-Relational Revolution: Database Week SFNon-Relational Revolution: Database Week SF
Non-Relational Revolution: Database Week SFAmazon Web Services
 
Updated resume
Updated resumeUpdated resume
Updated resumeArun Kiran
 
Planning Your Cloud Strategy
Planning Your Cloud StrategyPlanning Your Cloud Strategy
Planning Your Cloud StrategyUthaiyashankar
 
Breaking Up the Monolith While Migrating to AWS (GPSTEC320) - AWS re:Invent 2018
Breaking Up the Monolith While Migrating to AWS (GPSTEC320) - AWS re:Invent 2018Breaking Up the Monolith While Migrating to AWS (GPSTEC320) - AWS re:Invent 2018
Breaking Up the Monolith While Migrating to AWS (GPSTEC320) - AWS re:Invent 2018Amazon Web Services
 

Similar to Introducing the Entity Framework (20)

The Entity Data Model
The Entity Data ModelThe Entity Data Model
The Entity Data Model
 
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
 
Introducing LINQ
Introducing LINQIntroducing LINQ
Introducing LINQ
 
Using The .NET Framework
Using The .NET FrameworkUsing The .NET Framework
Using The .NET Framework
 
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
 
Object-Oriented JavaScript
Object-Oriented JavaScriptObject-Oriented JavaScript
Object-Oriented JavaScript
 
Couchbase usage at Symantec
Couchbase usage at SymantecCouchbase usage at Symantec
Couchbase usage at Symantec
 
WPF: Working with Data
WPF: Working with DataWPF: Working with Data
WPF: Working with Data
 
O365Con18 - How to Run a Search Project in SharePoint - Matthew McDermott
O365Con18 - How to Run a Search Project in SharePoint -  Matthew McDermottO365Con18 - How to Run a Search Project in SharePoint -  Matthew McDermott
O365Con18 - How to Run a Search Project in SharePoint - Matthew McDermott
 
Getting Started with .NET
Getting Started with .NETGetting Started with .NET
Getting Started with .NET
 
SharePoint Document Management
SharePoint Document ManagementSharePoint Document Management
SharePoint Document Management
 
.NET Variables and Data Types
.NET Variables and Data Types.NET Variables and Data Types
.NET Variables and Data Types
 
Feature driven agile oriented web applications
Feature driven agile oriented web applicationsFeature driven agile oriented web applications
Feature driven agile oriented web applications
 
Non-Relational Revolution: Database Week SF
Non-Relational Revolution: Database Week SFNon-Relational Revolution: Database Week SF
Non-Relational Revolution: Database Week SF
 
Web API HTTP Pipeline
Web API HTTP PipelineWeb API HTTP Pipeline
Web API HTTP Pipeline
 
Non-Relational Revolution
Non-Relational RevolutionNon-Relational Revolution
Non-Relational Revolution
 
Updated resume
Updated resumeUpdated resume
Updated resume
 
Planning Your Cloud Strategy
Planning Your Cloud StrategyPlanning Your Cloud Strategy
Planning Your Cloud Strategy
 
Breaking Up the Monolith While Migrating to AWS (GPSTEC320) - AWS re:Invent 2018
Breaking Up the Monolith While Migrating to AWS (GPSTEC320) - AWS re:Invent 2018Breaking Up the Monolith While Migrating to AWS (GPSTEC320) - AWS re:Invent 2018
Breaking Up the Monolith While Migrating to AWS (GPSTEC320) - AWS re:Invent 2018
 

More from 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
 
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
 
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
 
Object oriented techniques
Object oriented techniquesObject oriented techniques
Object oriented techniquesLearnNowOnline
 
SharePoint: Introduction to InfoPath
SharePoint: Introduction to InfoPathSharePoint: Introduction to InfoPath
SharePoint: Introduction to InfoPathLearnNowOnline
 
Managing site collections
Managing site collectionsManaging site collections
Managing site collectionsLearnNowOnline
 
Sql 2012 development and programming
Sql 2012  development and programmingSql 2012  development and programming
Sql 2012 development and programmingLearnNowOnline
 
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
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVCLearnNowOnline
 
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
 

More from LearnNowOnline (19)

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
 
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
 
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
 
Object oriented techniques
Object oriented techniquesObject oriented techniques
Object oriented techniques
 
SharePoint: Introduction to InfoPath
SharePoint: Introduction to InfoPathSharePoint: Introduction to InfoPath
SharePoint: Introduction to InfoPath
 
Managing site collections
Managing site collectionsManaging site collections
Managing site collections
 
Web API Basics
Web API BasicsWeb API Basics
Web API Basics
 
SQL Server: Security
SQL Server: SecuritySQL Server: Security
SQL Server: Security
 
Sql 2012 development and programming
Sql 2012  development and programmingSql 2012  development and programming
Sql 2012 development and programming
 
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
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
 
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
 

Recently uploaded

[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 

Recently uploaded (20)

[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 

Introducing the Entity Framework

  • 1. Introducing the Entity Framework 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 about how object-relational mapping works to provide data access Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 4. Objectives • Learn about how object-relational mapping works to provide data access • Understand what the Entity Framework is and how it can provide robust data access services to applications Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 5. Objectives • Learn about how object-relational mapping works to provide data access • Understand what the Entity Framework is and how it can provide robust data access services to applications • See how to build a database-first Entity Data Model using Visual Studio Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 6. Objectives • Learn about how object-relational mapping works to provide data access • Understand what the Entity Framework is and how it can provide robust data access services to applications • See how to build a database-first Entity Data Model using Visual Studio • Explore the various Entity Framework APIs and tools Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 7. Agenda Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 8. Agenda • Object-Relational Mapping (ORM) and Data Access Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 9. Agenda • Object-Relational Mapping (ORM) and Data Access • The Entity Framework and Data Model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 10. Agenda • Object-Relational Mapping (ORM) and Data Access • The Entity Framework and Data Model • Building a Simple Application using Entity Framework Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 11. Agenda • Object-Relational Mapping (ORM) and Data Access • The Entity Framework and Data Model • Building a Simple Application using Entity Framework • Entity Framework APIs and Tools Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 12. Object-Relational Mapping (ORM) Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 13. Object-Relational Mapping (ORM) • Just about all applications make use of data Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 14. Object-Relational Mapping (ORM) • Just about all applications make use of data • Microsoft has a long history of providing data access technologies Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 15. Object-Relational Mapping (ORM) • Just about all applications make use of data • Microsoft has a long history of providing data access technologies • But they have problems Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 16. Object-Relational Mapping (ORM) • Just about all applications make use of data • Microsoft has a long history of providing data access technologies • But they have problems  Too close to the metal Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 17. Object-Relational Mapping (ORM) • Just about all applications make use of data • Microsoft has a long history of providing data access technologies • But they have problems  Too close to the metal  Use generic data objects Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 18. Object-Relational Mapping (ORM) • Just about all applications make use of data • Microsoft has a long history of providing data access technologies • But they have problems  Too close to the metal  Use generic data objects • Data access code is usually a lot of code Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 19. Object-Relational Mapping (ORM) • Just about all applications make use of data • Microsoft has a long history of providing data access technologies • But they have problems  Too close to the metal  Use generic data objects • Data access code is usually a lot of code • Differences between objects and database Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 20. Object-Relational Mapping (ORM) • Just about all applications make use of data • Microsoft has a long history of providing data access technologies • But they have problems  Too close to the metal  Use generic data objects • Data access code is usually a lot of code • Differences between objects and database • Entity Framework bridges the gap Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 21. Object-Relational Mapping (ORM) • Just about all applications make use of data • Microsoft has a long history of providing data access technologies • But they have problems  Too close to the metal  Use generic data objects • Data access code is usually a lot of code • Differences between objects and database • Entity Framework bridges the gap • Terminology: data store and database Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 22. Object/Relational Differences Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 23. Object/Relational Differences • Inherent problems application has to overcome Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 24. Object/Relational Differences • Inherent problems application has to overcome  Needs lots of code somewhere Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 25. Object/Relational Differences • Inherent problems application has to overcome  Needs lots of code somewhere  Big impact on application design, effort, and performance Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 26. Object/Relational Differences • Inherent problems application has to overcome  Needs lots of code somewhere  Big impact on application design, effort, and performance • Will discuss in the context of a relational database Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 27. Data Type Differences Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 28. Data Type Differences • Many kinds of data types Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 29. Data Type Differences • Many kinds of data types • SQL Server 2008 R2 data types: Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 30. Data Type Differences • Many kinds of data types • SQL Server 2008 R2 data types: bigint binary bit char CLR date datetime datetime2 datetimeoffset decimal float hierarchyid image int money nchar ntext numeric nvarchar real rowversion smalldatetime smallint smallmoney sql_variant table text time timestamp tinyint varbinary varchar uniqueidentifier Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 31. Data Type Differences • Many kinds of data types • SQL Server 2008 R2 data types: bigint binary bit char CLR date datetime datetime2 datetimeoffset decimal float hierarchyid image int money nchar ntext numeric nvarchar real rowversion smalldatetime smallint smallmoney sql_variant table text time timestamp tinyint varbinary varchar uniqueidentifier Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 32. Data Type Differences • Many kinds of data types • SQL Server 2008 R2 data types: bigint binary bit char CLR date datetime datetime2 datetimeoffset decimal float hierarchyid image int money nchar ntext numeric nvarchar real rowversion smalldatetime smallint smallmoney sql_variant table text time timestamp tinyint varbinary varchar uniqueidentifier Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 33. Data Type Differences • Many kinds of data types • SQL Server 2008 R2 data types: bigint binary bit char CLR date datetime datetime2 datetimeoffset decimal float hierarchyid image int money nchar ntext numeric nvarchar real rowversion smalldatetime smallint smallmoney sql_variant table text time timestamp tinyint varbinary varchar uniqueidentifier Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 34. Data Type Differences • Many kinds of data types • SQL Server 2008 R2 data types: bigint binary bit char CLR date datetime datetime2 datetimeoffset decimal float hierarchyid image int money nchar ntext numeric nvarchar real rowversion smalldatetime smallint smallmoney sql_variant table text time timestamp tinyint varbinary varchar uniqueidentifier • Some have direct equivalents in .NET • Database types often have constraints • Binary data in the database can be anything • Dates and times are another issue Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 35. Relationship Difference Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 36. Relationship Difference • Databases use foreign key constraints Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 37. Relationship Difference • Databases use foreign key constraints • .NET objects use object references Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 38. Relationship Difference • Databases use foreign key constraints • .NET objects use object references • SalesOrderHeader and SalesOrderDetail tables Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 39. Relationship Difference • Databases use foreign key constraints • .NET objects use object references • SalesOrderHeader and SalesOrderDetail tables Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 40. Relationship Difference • Databases use foreign key constraints • .NET objects use object references • SalesOrderHeader and SalesOrderDetail tables Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 41. Relationship Difference Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 42. Relationship Difference • Many-to-Many relationships Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 43. Relationship Difference • Many-to-Many relationships • In AdventureWorks, customers and addresses Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 44. Relationship Difference • Many-to-Many relationships • In AdventureWorks, customers and addresses Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 45. Relationship Difference • Many-to-Many relationships • In AdventureWorks, customers and addresses Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 46. Relationship Difference • Many-to-Many relationships • In AdventureWorks, customers and addresses Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 47. Relationship Difference • Many-to-Many relationships • In AdventureWorks, customers and addresses • Not the default objects Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 48. Inheritance Difference Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 49. Inheritance Difference • .NET supports object inheritance Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 50. Inheritance Difference • .NET supports object inheritance  No support for multiple inheritance Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 51. Inheritance Difference • .NET supports object inheritance  No support for multiple inheritance • Inheritance makes code simpler, maintainable, easier to debug Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 52. Inheritance Difference • .NET supports object inheritance  No support for multiple inheritance • Inheritance makes code simpler, maintainable, easier to debug  Model hierarchies of objects Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 53. Inheritance Difference • .NET supports object inheritance  No support for multiple inheritance • Inheritance makes code simpler, maintainable, easier to debug  Model hierarchies of objects • Relational databases don’t support inheritance Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 54. Inheritance Difference • .NET supports object inheritance  No support for multiple inheritance • Inheritance makes code simpler, maintainable, easier to debug  Model hierarchies of objects • Relational databases don’t support inheritance • Some ways to accomplish it Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 55. Inheritance Difference • .NET supports object inheritance  No support for multiple inheritance • Inheritance makes code simpler, maintainable, easier to debug  Model hierarchies of objects • Relational databases don’t support inheritance • Some ways to accomplish it  Table per type Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 56. Inheritance Difference • .NET supports object inheritance  No support for multiple inheritance • Inheritance makes code simpler, maintainable, easier to debug  Model hierarchies of objects • Relational databases don’t support inheritance • Some ways to accomplish it  Table per type  Table per concrete type Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 57. Inheritance Difference • .NET supports object inheritance  No support for multiple inheritance • Inheritance makes code simpler, maintainable, easier to debug  Model hierarchies of objects • Relational databases don’t support inheritance • Some ways to accomplish it  Table per type  Table per concrete type  Table per hierarchy Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 58. Inheritance Difference • .NET supports object inheritance  No support for multiple inheritance • Inheritance makes code simpler, maintainable, easier to debug  Model hierarchies of objects • Relational databases don’t support inheritance • Some ways to accomplish it  Table per type  Table per concrete type  Table per hierarchy • Have to manage special constraints Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 59. Identity/Equality Difference Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 60. Identity/Equality Difference • How do you tell two things are the same? Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 61. Identity/Equality Difference • How do you tell two things are the same? • Database: identity of a row is the primary key Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 62. Identity/Equality Difference • How do you tell two things are the same? • Database: identity of a row is the primary key  Enforced by a primary key constraint Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 63. Identity/Equality Difference • How do you tell two things are the same? • Database: identity of a row is the primary key  Enforced by a primary key constraint  Can use either natural or surrogate keys Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 64. Identity/Equality Difference • How do you tell two things are the same? • Database: identity of a row is the primary key  Enforced by a primary key constraint  Can use either natural or surrogate keys • Objects in object-oriented application Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 65. Identity/Equality Difference • How do you tell two things are the same? • Database: identity of a row is the primary key  Enforced by a primary key constraint  Can use either natural or surrogate keys • Objects in object-oriented application  Two objects with the same data are not equal Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 66. Identity/Equality Difference • How do you tell two things are the same? • Database: identity of a row is the primary key  Enforced by a primary key constraint  Can use either natural or surrogate keys • Objects in object-oriented application  Two objects with the same data are not equal  Two variables, each with reference to different objects, are not equal Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 67. Identity/Equality Difference • How do you tell two things are the same? • Database: identity of a row is the primary key  Enforced by a primary key constraint  Can use either natural or surrogate keys • Objects in object-oriented application  Two objects with the same data are not equal  Two variables, each with reference to different objects, are not equal  Two variables with reference to same object are equal Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 68. Identity/Equality Difference • How do you tell two things are the same? • Database: identity of a row is the primary key  Enforced by a primary key constraint  Can use either natural or surrogate keys • Objects in object-oriented application  Two objects with the same data are not equal  Two variables, each with reference to different objects, are not equal  Two variables with reference to same object are equal  Can make a custom definition Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 69. Handling the Differences Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 70. Handling the Differences • Can be an lot of work to handle object/relational differences Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 71. Handling the Differences • Can be an lot of work to handle object/relational differences  But at least they are well understood Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 72. Handling the Differences • Can be an lot of work to handle object/relational differences  But at least they are well understood  Doesn’t mean it’s easy Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 73. Handling the Differences • Can be an lot of work to handle object/relational differences  But at least they are well understood  Doesn’t mean it’s easy • Write the code yourself, or use a framework Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 74. Object-Relational Mapping (ORM) Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 75. Object-Relational Mapping (ORM) • Programming technique for conversion of incompatible types Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 76. Object-Relational Mapping (ORM) • Programming technique for conversion of incompatible types • Most ORM tools rely on metadata about database and objects Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 77. Object-Relational Mapping (ORM) • Programming technique for conversion of incompatible types • Most ORM tools rely on metadata about database and objects • Clean separation of concerns Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 78. Object-Relational Mapping (ORM) • Programming technique for conversion of incompatible types • Most ORM tools rely on metadata about database and objects • Clean separation of concerns • Key feature is mapping Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 79. Object-Relational Mapping (ORM) • Programming technique for conversion of incompatible types • Most ORM tools rely on metadata about database and objects • Clean separation of concerns • Key feature is mapping  Expresses how an object is related to a table Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 80. Object-Relational Mapping (ORM) • Programming technique for conversion of incompatible types • Most ORM tools rely on metadata about database and objects • Clean separation of concerns • Key feature is mapping  Expresses how an object is related to a table  ORM uses to manage conversion process Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 81. Object-Relational Mapping (ORM) • Programming technique for conversion of incompatible types • Most ORM tools rely on metadata about database and objects • Clean separation of concerns • Key feature is mapping  Expresses how an object is related to a table  ORM uses to manage conversion process • ORM manages application’s interactions with database Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 82. Benefits to using an ORM Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 83. Benefits to using an ORM • Productivity Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 84. Benefits to using an ORM • Productivity • Better application design Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 85. Benefits to using an ORM • Productivity • Better application design • Code reuse Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 86. Benefits to using an ORM • Productivity • Better application design • Code reuse • Application maintainability Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 87. Benefits to using an ORM • Productivity • Better application design • Code reuse • Application maintainability • Potential downside: performance Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 88. Benefits to using an ORM • Productivity • Better application design • Code reuse • Application maintainability • Potential downside: performance  More complex code Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 89. Benefits to using an ORM • Productivity • Better application design • Code reuse • Application maintainability • Potential downside: performance  More complex code  Means slower performance Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 90. Benefits to using an ORM • Productivity • Better application design • Code reuse • Application maintainability • Potential downside: performance  More complex code  Means slower performance  But ORM code is likely to be well tuned Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 91. Benefits to using an ORM • Productivity • Better application design • Code reuse • Application maintainability • Potential downside: performance  More complex code  Means slower performance  But ORM code is likely to be well tuned  Data access time may be minimal Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 92. Benefits to using an ORM • Productivity • Better application design • Code reuse • Application maintainability • Potential downside: performance  More complex code  Means slower performance  But ORM code is likely to be well tuned  Data access time may be minimal • Lots of ORMs available for .NET Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 93. Generic Data Objects vs. Entity Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 94. Generic Data Objects vs. Entity • ADO.NET has long had generic data objects Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 95. Generic Data Objects vs. Entity • ADO.NET has long had generic data objects • Most common: Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 96. Generic Data Objects vs. Entity • ADO.NET has long had generic data objects • Most common:  SqlConnection and OleDbConnection Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 97. Generic Data Objects vs. Entity • ADO.NET has long had generic data objects • Most common:  SqlConnection and OleDbConnection  SqlDataAdapter and OleDbAdapter Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 98. Generic Data Objects vs. Entity • ADO.NET has long had generic data objects • Most common:  SqlConnection and OleDbConnection  SqlDataAdapter and OleDbAdapter  DataSet Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 99. Generic Data Objects vs. Entity • ADO.NET has long had generic data objects • Most common:  SqlConnection and OleDbConnection  SqlDataAdapter and OleDbAdapter  DataSet  DataTable Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 100. Generic Data Objects vs. Entity • ADO.NET has long had generic data objects • Most common:  SqlConnection and OleDbConnection  SqlDataAdapter and OleDbAdapter  DataSet  DataTable  SqlDataReader and OleDbDataReader Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 101. Generic Data Objects vs. Entity • ADO.NET has long had generic data objects • Most common:  SqlConnection and OleDbConnection  SqlDataAdapter and OleDbAdapter  DataSet  DataTable  SqlDataReader and OleDbDataReader • Provide a means for accessing data in database Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 102. Generic Data Objects vs. Entity • ADO.NET has long had generic data objects • Most common:  SqlConnection and OleDbConnection  SqlDataAdapter and OleDbAdapter  DataSet  DataTable  SqlDataReader and OleDbDataReader • Provide a means for accessing data in database  DataSet and DataTable contain rows and columns Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 103. Generic Data Objects Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 104. Generic Data Objects • Problems with Generic Data Objects Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 105. Generic Data Objects • Problems with Generic Data Objects  Strong coupling between application and database Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 106. Generic Data Objects • Problems with Generic Data Objects  Strong coupling between application and database  Loose typing Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 107. Generic Data Objects • Problems with Generic Data Objects  Strong coupling between application and database  Loose typing  Object interactions Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 108. Generic Data Objects • Problems with Generic Data Objects  Strong coupling between application and database  Loose typing  Object interactions • Problems persist despite long use Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 109. Generic Data Objects • Problems with Generic Data Objects  Strong coupling between application and database  Loose typing  Object interactions • Problems persist despite long use  Every application has to deal with them Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 110. Generic Data Objects • Problems with Generic Data Objects  Strong coupling between application and database  Loose typing  Object interactions • Problems persist despite long use  Every application has to deal with them  But it’s been the best we’ve had, other than custom objects Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 111. Entity Data Objects Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 112. Entity Data Objects • Big improvement over what came before Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 113. Entity Data Objects • Big improvement over what came before  Instead of using a generic DataSet, use Customer, Order, and OrderDetail Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 114. Entity Data Objects • Big improvement over what came before  Instead of using a generic DataSet, use Customer, Order, and OrderDetail  Navigation properties to access related data Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 115. Entity Data Objects • Big improvement over what came before  Instead of using a generic DataSet, use Customer, Order, and OrderDetail  Navigation properties to access related data  Fit into object-oriented application Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 116. Entity Data Objects • Big improvement over what came before  Instead of using a generic DataSet, use Customer, Order, and OrderDetail  Navigation properties to access related data  Fit into object-oriented application • Object interfaces can mirror tables and fields Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 117. Entity Data Objects • Big improvement over what came before  Instead of using a generic DataSet, use Customer, Order, and OrderDetail  Navigation properties to access related data  Fit into object-oriented application • Object interfaces can mirror tables and fields  Or be completely different Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 118. Entity Data Objects • Big improvement over what came before  Instead of using a generic DataSet, use Customer, Order, and OrderDetail  Navigation properties to access related data  Fit into object-oriented application • Object interfaces can mirror tables and fields  Or be completely different  Or something in between Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 119. Entity Data Objects • Big improvement over what came before  Instead of using a generic DataSet, use Customer, Order, and OrderDetail  Navigation properties to access related data  Fit into object-oriented application • Object interfaces can mirror tables and fields  Or be completely different  Or something in between • Need a way to map objects to database Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 120. Benefits of Entity Data Objects Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 121. Benefits of Entity Data Objects • Strong typing Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 122. Benefits of Entity Data Objects • Strong typing • Compile-time checking Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 123. Benefits of Entity Data Objects • Strong typing • Compile-time checking • Persistence ignorance Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 124. Benefits of Entity Data Objects • Strong typing • Compile-time checking • Persistence ignorance • Productivity Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 125. Data Programming Against a Model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 126. Data Programming Against a Model • Will have to change how you think about data in an application Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 127. Data Programming Against a Model • Will have to change how you think about data in an application  No longer interacting directly with the database Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 128. Data Programming Against a Model • Will have to change how you think about data in an application  No longer interacting directly with the database  Instead working with objects Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 129. Data Programming Against a Model • Will have to change how you think about data in an application  No longer interacting directly with the database  Instead working with objects  Very different paradigms Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 130. Data Programming Against a Model • Will have to change how you think about data in an application  No longer interacting directly with the database  Instead working with objects  Very different paradigms • The model is not the database! Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 131. Data Programming Against a Model • Will have to change how you think about data in an application  No longer interacting directly with the database  Instead working with objects  Very different paradigms • The model is not the database! • Generic data objects require lots of code Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 132. Data Programming Against a Model • Will have to change how you think about data in an application  No longer interacting directly with the database  Instead working with objects  Very different paradigms • The model is not the database! • Generic data objects require lots of code • Entity data objects mean querying a schema that reflects business model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 133. Data Programming Against a Model • Will have to change how you think about data in an application  No longer interacting directly with the database  Instead working with objects  Very different paradigms • The model is not the database! • Generic data objects require lots of code • Entity data objects mean querying a schema that reflects business model • ORM eliminates context shift in code Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 134. Agenda Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 135. Agenda • Object-Relational Mapping (ORM) and Data Access Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 136. Agenda • Object-Relational Mapping (ORM) and Data Access • The Entity Framework and Data Model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 137. Agenda • Object-Relational Mapping (ORM) and Data Access • The Entity Framework and Data Model • Building a Simple Application using Entity Framework Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 138. Agenda • Object-Relational Mapping (ORM) and Data Access • The Entity Framework and Data Model • Building a Simple Application using Entity Framework • Entity Framework APIs and Tools Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 139. The Entity Framework and Data Model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 140. The Entity Framework and Data Model • Complete ORM for .NET applications Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 141. The Entity Framework and Data Model • Complete ORM for .NET applications • Microsoft’s new core data access technology Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 142. The Entity Framework and Data Model • Complete ORM for .NET applications • Microsoft’s new core data access technology  Big commitment from the company Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 143. The Entity Framework and Data Model • Complete ORM for .NET applications • Microsoft’s new core data access technology  Big commitment from the company • Initial release didn’t gain much traction Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 144. The Entity Framework and Data Model • Complete ORM for .NET applications • Microsoft’s new core data access technology  Big commitment from the company • Initial release didn’t gain much traction • Version 4.1 is a mature product Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 145. The Entity Framework and Data Model • Complete ORM for .NET applications • Microsoft’s new core data access technology  Big commitment from the company • Initial release didn’t gain much traction • Version 4.1 is a mature product  Substantial commitment and innovation Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 146. The Entity Framework and Data Model • Complete ORM for .NET applications • Microsoft’s new core data access technology  Big commitment from the company • Initial release didn’t gain much traction • Version 4.1 is a mature product  Substantial commitment and innovation • Do we need a new data access technology? Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 147. The Entity Framework and Data Model • Complete ORM for .NET applications • Microsoft’s new core data access technology  Big commitment from the company • Initial release didn’t gain much traction • Version 4.1 is a mature product  Substantial commitment and innovation • Do we need a new data access technology?  Older technologies have run their course Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 148. The Entity Framework and Data Model • Complete ORM for .NET applications • Microsoft’s new core data access technology  Big commitment from the company • Initial release didn’t gain much traction • Version 4.1 is a mature product  Substantial commitment and innovation • Do we need a new data access technology?  Older technologies have run their course  Modern applications have to focus on domain model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 149. The Entity Framework and Data Model • Complete ORM for .NET applications • Microsoft’s new core data access technology  Big commitment from the company • Initial release didn’t gain much traction • Version 4.1 is a mature product  Substantial commitment and innovation • Do we need a new data access technology?  Older technologies have run their course  Modern applications have to focus on domain model • Version numbers Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 150. Entity Data Model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 151. Entity Data Model • Integral part of Entity Framework Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 152. Entity Data Model • Integral part of Entity Framework • Client-side model different from database schema Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 153. Entity Data Model • Integral part of Entity Framework • Client-side model different from database schema • Describes structure of entity data objects Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 154. Entity Data Model • Integral part of Entity Framework • Client-side model different from database schema • Describes structure of entity data objects • Take the database schema and reshape it into objects Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 155. Entity Data Model • Integral part of Entity Framework • Client-side model different from database schema • Describes structure of entity data objects • Take the database schema and reshape it into objects • Defined by three chunks of XML in a single .edmx file Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 156. Entity Data Model • Integral part of Entity Framework • Client-side model different from database schema • Describes structure of entity data objects • Take the database schema and reshape it into objects • Defined by three chunks of XML in a single .edmx file  Conceptual model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 157. Entity Data Model • Integral part of Entity Framework • Client-side model different from database schema • Describes structure of entity data objects • Take the database schema and reshape it into objects • Defined by three chunks of XML in a single .edmx file  Conceptual model  Storage model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 158. Entity Data Model • Integral part of Entity Framework • Client-side model different from database schema • Describes structure of entity data objects • Take the database schema and reshape it into objects • Defined by three chunks of XML in a single .edmx file  Conceptual model  Storage model  Mapping Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 159. LINQ to SQL Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 160. LINQ to SQL • Similar to Entity Framework Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 161. LINQ to SQL • Similar to Entity Framework  Both use LINQ to query a database using a data model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 162. LINQ to SQL • Similar to Entity Framework  Both use LINQ to query a database using a data model • Developed independently at Microsoft Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 163. LINQ to SQL • Similar to Entity Framework  Both use LINQ to query a database using a data model • Developed independently at Microsoft  LINQ to SQL grew out of LINQ team Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 164. LINQ to SQL • Similar to Entity Framework  Both use LINQ to query a database using a data model • Developed independently at Microsoft  LINQ to SQL grew out of LINQ team  Entity Framework grew out of Data Programmability team Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 165. LINQ to SQL • Similar to Entity Framework  Both use LINQ to query a database using a data model • Developed independently at Microsoft  LINQ to SQL grew out of LINQ team  Entity Framework grew out of Data Programmability team • Soon Microsoft had two new data access technologies Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 166. LINQ to SQL • Similar to Entity Framework  Both use LINQ to query a database using a data model • Developed independently at Microsoft  LINQ to SQL grew out of LINQ team  Entity Framework grew out of Data Programmability team • Soon Microsoft had two new data access technologies • LINQ to SQL moved, and lost out to Entity Framework Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 167. Why Use Entity Framework? Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 168. Why Use Entity Framework? • Part of the .NET Framework and integrated into Visual Studio Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 169. Why Use Entity Framework? • Part of the .NET Framework and integrated into Visual Studio • Uses LINQ as the primary query language Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 170. Why Use Entity Framework? • Part of the .NET Framework and integrated into Visual Studio • Uses LINQ as the primary query language • Independent of the data source Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 171. Why Use Entity Framework? • Part of the .NET Framework and integrated into Visual Studio • Uses LINQ as the primary query language • Independent of the data source • Microsoft’s primary data access strategy Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 172. When Should You Not Use Entity Framework or an ORM? Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 173. When Should You Not Use Entity Framework or an ORM? • Entity Framework is not a panacea Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 174. When Should You Not Use Entity Framework or an ORM? • Entity Framework is not a panacea  Not an instant data access panacea Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 175. When Should You Not Use Entity Framework or an ORM? • Entity Framework is not a panacea  Not an instant data access panacea  Isn’t appropriate for every kind of application Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 176. When Should You Not Use Entity Framework or an ORM? • Entity Framework is not a panacea  Not an instant data access panacea  Isn’t appropriate for every kind of application  Doesn’t do bulk inserts Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 177. Agenda Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 178. Agenda • Object-Relational Mapping (ORM) and Data Access Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 179. Agenda • Object-Relational Mapping (ORM) and Data Access • The Entity Framework and Data Model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 180. Agenda • Object-Relational Mapping (ORM) and Data Access • The Entity Framework and Data Model • Building a Simple Application using Entity Framework Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 181. Agenda • Object-Relational Mapping (ORM) and Data Access • The Entity Framework and Data Model • Building a Simple Application using Entity Framework • Entity Framework APIs and Tools Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 182. Building a Simple Application using Entity Framework Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 183. Building a Simple Application using Entity Framework • Compelling reason to use Entity Framework is its integration with Visual Studio Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 184. Building a Simple Application using Entity Framework • Compelling reason to use Entity Framework is its integration with Visual Studio • Sample is based on AdventureWorksLT Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 185. Building a Simple Application using Entity Framework • Compelling reason to use Entity Framework is its integration with Visual Studio • Sample is based on AdventureWorksLT  Ten tables with data about customers, products, and orders Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 186. Building a Simple Application using Entity Framework • Compelling reason to use Entity Framework is its integration with Visual Studio • Sample is based on AdventureWorksLT  Ten tables with data about customers, products, and orders  Complex enough to exercise Entity Framework Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 187. Building a Simple Application using Entity Framework • Compelling reason to use Entity Framework is its integration with Visual Studio • Sample is based on AdventureWorksLT  Ten tables with data about customers, products, and orders  Complex enough to exercise Entity Framework • Will build sample as a class library Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 188. Building a Simple Application using Entity Framework • Compelling reason to use Entity Framework is its integration with Visual Studio • Sample is based on AdventureWorksLT  Ten tables with data about customers, products, and orders  Complex enough to exercise Entity Framework • Will build sample as a class library  Easy to reuse in multiple applications Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 189. Building a Simple Application using Entity Framework • Compelling reason to use Entity Framework is its integration with Visual Studio • Sample is based on AdventureWorksLT  Ten tables with data about customers, products, and orders  Complex enough to exercise Entity Framework • Will build sample as a class library  Easy to reuse in multiple applications  Not absolutely necessary Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 190. Building a Simple Application using Entity Framework • Compelling reason to use Entity Framework is its integration with Visual Studio • Sample is based on AdventureWorksLT  Ten tables with data about customers, products, and orders  Complex enough to exercise Entity Framework • Will build sample as a class library  Easy to reuse in multiple applications  Not absolutely necessary • Mostly create simple console applications Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 191. Using the Entity Objects Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 192. Using the Entity Objects • Time to use the entity data objects in an application Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 193. Using the Entity Objects • Time to use the entity data objects in an application • Simple console application Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 194. Using the Entity Objects • Time to use the entity data objects in an application • Simple console application • Need to do three things to use the class library Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 195. Using the Entity Objects • Time to use the entity data objects in an application • Simple console application • Need to do three things to use the class library  Add a reference to the class library Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 196. Using the Entity Objects • Time to use the entity data objects in an application • Simple console application • Need to do three things to use the class library  Add a reference to the class library  Add a reference to System.Data.Entity Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 197. Using the Entity Objects • Time to use the entity data objects in an application • Simple console application • Need to do three things to use the class library  Add a reference to the class library  Add a reference to System.Data.Entity  Add the Entity Framework connection string Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 198. Using the Entity Objects • Time to use the entity data objects in an application • Simple console application • Need to do three things to use the class library  Add a reference to the class library  Add a reference to System.Data.Entity  Add the Entity Framework connection string • And, of course, write some code! Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 199. Agenda Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 200. Agenda • Object-Relational Mapping (ORM) and Data Access Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 201. Agenda • Object-Relational Mapping (ORM) and Data Access • The Entity Framework and Data Model Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 202. Agenda • Object-Relational Mapping (ORM) and Data Access • The Entity Framework and Data Model • Building a Simple Application using Entity Framework Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 203. Agenda • Object-Relational Mapping (ORM) and Data Access • The Entity Framework and Data Model • Building a Simple Application using Entity Framework • Entity Framework APIs and Tools Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 204. Entity Framework APIs and Tools Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 205. Entity Framework APIs and Tools • Entity Framework is a complex set of APIs and design tools Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 206. Entity Framework APIs and Tools • Entity Framework is a complex set of APIs and design tools • Need a basic understanding of what each of the Entity Framework components do Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 207. Entity Framework APIs and Tools • Entity Framework is a complex set of APIs and design tools • Need a basic understanding of what each of the Entity Framework components do  Road to deep understanding Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 208. Architecture Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 209. Application Architecture Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 210. Application Architecture Entity SQL LINQ to Entities Query Query Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 211. Application Architecture Entity SQL LINQ to Entities Query Query Object Services Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 212. Application Architecture Entity SQL LINQ to Entities Query Query Results Object Services Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 213. Application Architecture Entity SQL LINQ to Entities Query Query Results Object Services Command Tree Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 214. Application Architecture Entity SQL LINQ to Entities Query Query Results Object Services Command Tree EntityClient Data Provider Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 215. Application Architecture Entity SQL LINQ to Entities Query Query Results Object Services Command Entity Tree Data Reader EntityClient Data Provider Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 216. Application Architecture Entity SQL LINQ to Entities Query Query Results Entity SQL Query Object Services Command Entity Tree Data Reader EntityClient Data Provider Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 217. Application Architecture Entity SQL LINQ to Entities Query Query Results Entity SQL Query Object Services Command Entity Tree Data Reader EntityClient Data Provider Command Tree Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 218. Application Architecture Entity SQL LINQ to Entities Query Query Results Entity SQL Query Object Services Command Entity Tree Data Reader EntityClient Data Provider Command Tree ADO.NET Data Providers Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 219. Application Architecture Entity SQL LINQ to Entities Query Query Results Entity SQL Query Object Services Command Entity Tree Data Reader EntityClient Data Provider Command Tree DB Data Reader ADO.NET Data Providers Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 220. Application Architecture Entity SQL LINQ to Entities Query Query Results Entity SQL Query Object Services Command Entity Tree Data Reader EntityClient Data Provider Command Tree DB Data Reader ADO.NET Data Providers Data Store Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 221. Application Architecture Entity SQL LINQ to Entities Query Query Entity Data Results Entity Model SQL Query Object Services Command Entity Tree Data Reader EntityClient Data Provider Command Tree DB Data Reader ADO.NET Data Providers Data Store Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 222. Application Architecture Entity SQL LINQ to Entities Query Query Entity Data Results Entity Model SQL Query Object Services Conceptual Model Command Entity Tree Data Reader EntityClient Data Provider Command Tree DB Data Reader ADO.NET Data Providers Data Store Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 223. Application Architecture Entity SQL LINQ to Entities Query Query Entity Data Results Entity Model SQL Query Object Services Conceptual Model Command Entity Tree Data Reader EntityClient Data Provider Command Tree DB Data Storage Reader Model ADO.NET Data Providers Data Store Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 224. Application Architecture Entity SQL LINQ to Entities Query Query Entity Data Results Entity Model SQL Query Object Services Conceptual Model Command Entity Tree Data Reader Mapping EntityClient Data Provider Command Tree DB Data Storage Reader Model ADO.NET Data Providers Data Store Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 225. Entity Data Model Designer Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 226. Entity Data Model Designer • Part of Visual Studio Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 227. Entity Data Model Designer • Part of Visual Studio • Lets you work with model graphically rather than as raw XML Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 228. Entity Data Model Designer • Part of Visual Studio • Lets you work with model graphically rather than as raw XML • First saw as part of the AdventureWorksLibrary project Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 229. Entity Data Model Designer • Part of Visual Studio • Lets you work with model graphically rather than as raw XML • First saw as part of the AdventureWorksLibrary project • Doesn’t support all Entity Data Model features Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 230. Entity Data Model Designer • Part of Visual Studio • Lets you work with model graphically rather than as raw XML • First saw as part of the AdventureWorksLibrary project • Doesn’t support all Entity Data Model features • Lets you map tables, views, stored procedures and functions to entities Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 231. Entity Data Model Designer • Part of Visual Studio • Lets you work with model graphically rather than as raw XML • First saw as part of the AdventureWorksLibrary project • Doesn’t support all Entity Data Model features • Lets you map tables, views, stored procedures and functions to entities  Can update the model from the underlying database Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 232. Design Methodologies Using the Designer Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 233. Design Methodologies Using the Designer • Two broad ways to build a data application Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 234. Design Methodologies Using the Designer • Two broad ways to build a data application  Top-down design Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 235. Design Methodologies Using the Designer • Two broad ways to build a data application  Top-down design  Bottom-up design Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 236. Design Methodologies Using the Designer • Two broad ways to build a data application  Top-down design  Bottom-up design • Neither is necessarily better than the other Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 237. Design Methodologies Using the Designer • Two broad ways to build a data application  Top-down design  Bottom-up design • Neither is necessarily better than the other • Entity Framework supports both Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 238. Design Methodologies Using the Designer • Two broad ways to build a data application  Top-down design  Bottom-up design • Neither is necessarily better than the other • Entity Framework supports both • Provides three ways to build an application Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 239. Design Methodologies Using the Designer • Two broad ways to build a data application  Top-down design  Bottom-up design • Neither is necessarily better than the other • Entity Framework supports both • Provides three ways to build an application  Database-first design Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 240. Design Methodologies Using the Designer • Two broad ways to build a data application  Top-down design  Bottom-up design • Neither is necessarily better than the other • Entity Framework supports both • Provides three ways to build an application  Database-first design  Model-first design Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 241. Design Methodologies Using the Designer • Two broad ways to build a data application  Top-down design  Bottom-up design • Neither is necessarily better than the other • Entity Framework supports both • Provides three ways to build an application  Database-first design  Model-first design  Code-first design Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 242. Code Generation Using T4 Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 243. Code Generation Using T4 • Entity Data Model designer generates code Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 244. Code Generation Using T4 • Entity Data Model designer generates code • Uses Visual Studio’s Text Template Transformation Toolkit (T4) Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company
  • 245. Code Generation Using T4 • Entity Data Model designer generates code • Uses Visual Studio’s Text Template Transformation Toolkit (T4)  Generates classes in designer code file Learn More @ http://www.learnnowonline.com Copyright © by Application Developers Training Company

Editor's Notes

  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. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. \n
  72. \n
  73. \n
  74. \n
  75. \n
  76. \n
  77. \n
  78. \n
  79. \n
  80. \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. \n
  94. \n
  95. \n
  96. \n
  97. \n
  98. \n
  99. \n
  100. \n
  101. \n
  102. \n
  103. \n
  104. \n
  105. \n
  106. \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. \n
  125. \n
  126. \n
  127. \n
  128. \n
  129. \n
  130. \n
  131. \n
  132. \n
  133. \n
  134. \n
  135. \n
  136. \n
  137. \n
  138. \n
  139. \n
  140. \n
  141. \n
  142. \n
  143. \n
  144. \n
  145. \n
  146. \n
  147. \n
  148. \n
  149. \n
  150. \n
  151. \n
  152. \n
  153. \n
  154. \n
  155. \n
  156. \n
  157. \n
  158. \n
  159. \n
  160. \n
  161. \n
  162. \n
  163. \n
  164. \n
  165. \n
  166. \n
  167. \n
  168. \n
  169. \n
  170. DEMO: Building the Entity Data Model and Objects, Exploring the New Entity Object Project\n
  171. DEMO: Building the Entity Data Model and Objects, Exploring the New Entity Object Project\n
  172. DEMO: Building the Entity Data Model and Objects, Exploring the New Entity Object Project\n
  173. DEMO: Building the Entity Data Model and Objects, Exploring the New Entity Object Project\n
  174. DEMO: Building the Entity Data Model and Objects, Exploring the New Entity Object Project\n
  175. DEMO: Building the Entity Data Model and Objects, Exploring the New Entity Object Project\n
  176. DEMO: Building the Entity Data Model and Objects, Exploring the New Entity Object Project\n
  177. DEMO: Building the Entity Data Model and Objects, Exploring the New Entity Object Project\n
  178. DEMO: Try It Out!\n
  179. DEMO: Try It Out!\n
  180. DEMO: Try It Out!\n
  181. DEMO: Try It Out!\n
  182. DEMO: Try It Out!\n
  183. DEMO: Try It Out!\n
  184. DEMO: Try It Out!\n
  185. \n
  186. \n
  187. \n
  188. \n
  189. \n
  190. \n
  191. \n
  192. \n
  193. \n
  194. \n
  195. \n
  196. \n
  197. \n
  198. \n
  199. \n
  200. \n
  201. \n
  202. \n
  203. \n
  204. \n
  205. \n
  206. \n
  207. \n
  208. \n
  209. \n
  210. \n
  211. \n
  212. \n
  213. \n
  214. \n
  215. \n
  216. \n
  217. \n
  218. \n
  219. \n
  220. \n
  221. \n
  222. \n
  223. \n
  224. \n
  225. \n
  226. \n
  227. \n
  228. \n
  229. \n
  230. \n
  231. \n
  232. \n
  233. \n
  234. \n
  235. \n
  236. \n
  237. \n
  238. \n
  239. \n
  240. \n
  241. \n
  242. \n
  243. \n
  244. \n
  245. \n
  246. \n
  247. \n
  248. \n
  249. \n
  250. \n
  251. \n
  252. \n
  253. \n
  254. \n
  255. \n
  256. \n
  257. \n
  258. \n
  259. \n
  260. DEMO: rest of section\n