Learn your way! Get started

Developing Applications with Entity Framework 4.1

with expert Don Kiely


Course at a glance

Included in these subscriptions:

  • Dev & IT Pro Video
  • Dev & IT Pro Power Pack

Release date 12/2/2011
Level Advanced
Runtime 11h 1m
Closed captioning N/A
Transcript N/A
eBooks / courseware Included
Hands-on labs Included
Sample code Included
Exams Included


Enterprise Solutions

Need reporting, custom learning tracks, or SCORM? Learn More



Course description

The course starts with an introduction to Entity Framework, where you will learn about data access and object-relational mapping, how the Entity Framework works and the tools it provides, and you will see how to build an entity data model. Then you will explore the entity data model in more detail, where you will learn about the model designer and the raw XML that actually defines the conceptual, storage, and mapping models. You will also learn how you can use stored procedures and functions with Entity Framework. Next you will learn about the most important ways to query data using Entity Framework objects. You are most likely to use LINQ to Entities, but other options include Entity SQL and an Entity Client API. After that, you will learn about the ways that you can modify and customize the entity data objects, using the model designer, partial classes and methods, and events. Finally, you will learn about code-first development, which we are confident is going to become the primary way to develop new Entity Framework applications.

Prerequisites

This course assumes you are familiar with the Entity Framework and using Visual Studio 2010.

Learning Paths

This course will help you prepare for the following certification and exam:
MCSD: Web Applications
70-487: Developing Windows Azure and Web Services

Meet the expert

Don Kiely is a featured instructor on many of our SQL Server and Visual Studio courses. He is a nationally recognized author, instructor, and consultant specializing in Microsoft technologies. Don has many years of teaching experience, is the author or co-author of several programming books, and has spoken at many industry conferences and user groups. In addition, Don is a consultant for a variety of companies that develop distributed applications for public and private organizations.

Course outline



Module 1

VB/C# Differences (14:45)
  • Introduction (03:09)
  • Syntax Differences (01:58)
  • LINQ syntax differences (01:56)
  • Lambda expressions (02:53)
  • Partial class differences (04:32)
  • Summary (00:15)
Object Relational Mapping/Data Access (45:14)
  • Introduction (02:31)
  • Object/Relational Differences (01:25)
  • Data Type Differences (04:17)
  • Relationship Difference (06:13)
  • Inheritance Difference (06:23)
  • Identity/Equality Difference (03:23)
  • Handling the Differences (01:36)
  • Object-Relational Mapping (ORM) (02:55)
  • Benefits to ORM (03:50)
  • Generic Data Objects vs Entity Objects (02:43)
  • Generic Data Objects (02:33)
  • Entity Data Objects (01:54)
  • Entity Data Object Benefits (02:43)
  • Data Programming against a model (02:14)
  • Summary (00:28)

Module 2

Create Entity Data Model (23:30)
  • Introduction (01:19)
  • Entity Data Model (01:20)
  • LINQ to SQL (01:52)
  • Why Use Entity Framework (04:02)
  • When Not to Use EF or an ORM (02:15)
  • Build an App w/Entity Framework (03:29)
  • Demo: Build a Class Library (08:21)
  • Summary (00:50)
Explore the Data Model (31:23)
  • Introduction (00:30)
  • Demo: Explore Data Model (02:10)
  • Demo: View Entities properties (01:10)
  • Demo: Examine Customer Object (03:14)
  • Demo: View Entity Mapping Details (01:58)
  • Demo: View Entity Relationships (02:06)
  • Demo: View underlying XML (03:13)
  • Demo: View .Designer file (02:45)
  • Demo: View app.config file (01:14)
  • Using Entity Objects (EO) (01:57)
  • Demo: Use EO in an app (10:44)
  • Summary (00:16)

Module 3

Explore APIs and Tools (23:17)
  • Introduction (00:42)
  • Architecture (03:57)
  • Entity Data Model Designer (01:31)
  • Design Methodologies w/Designer (04:14)
  • Generate Code Using T4 (01:37)
  • Object Services (02:49)
  • Entity Client (04:36)
  • Entity Framework Services (03:18)
  • Summary (00:29)
Entity Data Model (28:14)
  • Introduction (02:11)
  • Models within in Model (02:12)
  • Create/Use Entity Data Model (01:08)
  • Use Database-First Design (00:44)
  • Demo: Database-First Design (06:04)
  • Multiplicity (02:28)
  • Entity Model Properties (00:37)
  • Demo: Entity Model Properties (12:12)
  • Summary (00:33)

Module 4

Model First Designs (31:00)
  • Introduction (01:27)
  • Event Registration (02:30)
  • Demo: Create a New Model (01:45)
  • Demo: Add Items to Designer (01:26)
  • Demo: Add Entities (12:06)
  • Demo: Add Associations (03:29)
  • Demo: Create/Generate Database (02:52)
  • Demo: Examine Generated Code (05:07)
  • Summary (00:15)
Model Browser / XML (44:54)
  • Introduction (00:54)
  • Demo: Model Browser (01:44)
  • Entity Data Model in the Raw (02:18)
  • XML Definition Languages (01:45)
  • Demo: Explore the XML Code (00:26)
  • Demo: Outline the XML (01:22)
  • Demo: Designer Element (01:24)
  • Demo: Diagram Content (02:08)
  • Demo: Runtime Content (01:11)
  • Demo: Conceptual Models (01:37)
  • Demo: EntityContainer (01:06)
  • Demo: EntitySet/AssociationSet (02:20)
  • Demo: EntityType (03:27)
  • Demo: NavigationProperty (03:24)
  • Demo: Association Elements (02:35)
  • Demo: Storage Models (07:45)
  • Demo: Mappings (03:09)
  • Demo: ScalarProperty (02:06)
  • Model Build Mechanics (01:24)
  • MetadataArtifactProcessing (02:13)
  • Summary (00:28)

Module 5

Using Stored Procedures (33:38)
  • Introduction (02:25)
  • Ways to Use Stored Procedures (01:18)
  • Update Model from Database (02:40)
  • Demo: Define Stored Procedures (02:56)
  • Demo: Import into Model (04:28)
  • Demo: View Function Elements (04:17)
  • Change An Entity (00:48)
  • Demo: Change an Entity (04:37)
  • Demo: View Changed XML (01:55)
  • Demo: Test Stored Procedures (05:08)
  • Demo: View SQL Server Profiler (02:47)
  • Summary (00:13)
Stored Procedures To Read Data (20:25)
  • Introduction (01:19)
  • Demo: Read Data w/Stored Procs (11:15)
  • Demo: Test Reading Data (00:29)
  • Return a Scalar Value (00:59)
  • Demo: Return Scalar Value (05:55)
  • Demo: Test Scalar Value (00:11)
  • Summary (00:15)

Module 6

Querying Entity Framework (25:18)
  • Introduction (00:54)
  • Entity Framework Query Options (02:33)
  • Framework Architecture (01:03)
  • LINQPad (02:27)
  • Demo: LINQPad (05:21)
  • Demo: A Simple Query (07:16)
  • Demo: Examine Class Diagram (05:15)
  • Summary (00:25)
LINQ to Entities (47:17)
  • Introduction (00:55)
  • LINQ Primer (04:13)
  • LINQ Query Expressions (03:20)
  • LINQ Methods (02:17)
  • Demo: LINQ Query Expression (01:12)
  • Demo: LINQ Methods (03:01)
  • Which Syntax to use (03:12)
  • LINQ to Entities (00:45)
  • Projections (01:07)
  • Demo: Projections (14:22)
  • Querying Related Data (01:40)
  • Demo: Navigation References (05:10)
  • Demo: Navigation Collections (05:27)
  • Summary (00:30)

Module 7

Aggregates / Grouping/ Other Options (38:51)
  • Introduction (00:40)
  • Aggregates (00:43)
  • Demo: Aggregates (08:36)
  • Other Querying Options (01:08)
  • Querying w/Entity SQL (01:02)
  • Demo: Entity SQL (01:47)
  • Basic Entity SQL Syntax (01:42)
  • VALUE Keyword (01:17)
  • Demo: Parameterized Entity SQL (05:45)
  • Canonical Functions (02:47)
  • Entity SQL Method Syntax (01:16)
  • Demo: Entity SQL Method Syntax (02:57)
  • Directly Querying EntityClient (01:48)
  • Demo: Querying EntityClient (06:49)
  • Summary (00:27)
Updating Entities / Saving Data (24:42)
  • Introduction (02:42)
  • Updating Existing Entities (00:36)
  • Demo: Update an Entity (06:04)
  • Inserting New Entities (01:02)
  • Demo: Insert New Entities (07:29)
  • Deleting Entities (02:05)
  • Demo: Deleting Entities (04:15)
  • Summary (00:25)

Module 8

Modifying Entities in the Model Designer (01:03:57)
  • Introduction (02:02)
  • Sample AWLT Model (03:19)
  • Modify Entities in the Designer (00:59)
  • Organizing the Model (01:04)
  • Demo: Explore/Arrange Model (08:05)
  • Cleaning up the Model (00:44)
  • Messy Database (05:43)
  • Entities (00:40)
  • Demo: Explore Entity Names (08:15)
  • Entity Properties (00:42)
  • Demo: Explore Entity Props (12:31)
  • Navigation Properties (00:25)
  • Demo: Explore Navigation Props (10:50)
  • Default Values (02:37)
  • Demo: Default Values (05:27)
  • Summary (00:27)
Customizing Entities (25:43)
  • Introduction (02:45)
  • Demo: Entity Data Object Classes (03:59)
  • OnChanging/OnChanged Methods (01:10)
  • Demo: OnChanging/OnChanged (04:01)
  • Demo: Code to Use Partial Classes (03:55)
  • Demo: PropertyChangedValidation (03:18)
  • Demo: View a Computed Field (05:28)
  • Summary (01:03)

Module 9

Entity Framework Events (20:10)
  • Introduction (00:55)
  • ObjectContexts ObjectMaterialized (01:36)
  • ObjectContexts SavingChanges (03:38)
  • Demo: SavingChanges (04:00)
  • PropertyChanging / PropertyChanged (02:17)
  • AssociationChanged Event (01:42)
  • Demo: AssociationChanged Event (04:59)
  • Summary (00:59)
Creating Code-First Model (34:02)
  • Introduction (02:26)
  • Using Code-First (01:46)
  • Create/Use a Code-First Model (01:36)
  • Demo: Create a Code-First Model (00:23)
  • Demo: Create New Project (00:59)
  • Demo: Create the Model (00:37)
  • Demo: Implement Classes (03:42)
  • Demo: Add Navigation Properties (04:38)
  • Demo: Add Context Class (03:32)
  • Secret Behind the Magic (02:04)
  • Use Model in an MVC 3 App (01:28)
  • Demo: Create/View Customers (00:37)
  • Demo: Add Controller (09:49)
  • Summary (00:19)

Module 10

Create / Update the Code-First Database (35:05)
  • Introduction (01:10)
  • Demo: Run the Application (02:20)
  • Demo: Explore the Database (05:36)
  • Demo: Add Edit Support (08:37)
  • Demo: Add Delete Support (07:12)
  • Demo: Modify the Model (02:52)
  • Changing the Model (03:56)
  • Demo: Database.SetInitializer (02:51)
  • Summary (00:27)
Seeding / Customizing the Data (50:19)
  • Introduction (01:13)
  • Demo: Add Seed Data (06:40)
  • Demo: Drop/Create the Database (03:42)
  • Customizing the Database (04:44)
  • Common Conventions (02:50)
  • Data Annotations (01:20)
  • Demo: Data Annotations (10:01)
  • Demo: View Schema Changes (07:32)
  • DbModelBuilder API (01:19)
  • Demo: DbModelBuilder API (02:34)
  • Configure Properties and Entities (01:36)
  • Demo: Configure Properties / Entities (05:59)
  • Summary (00:44)