Learn your way! Get started

Entity Framework 6.1, Part 3: Querying and Updating

with expert Don Kiely

Watch trailer

Entity Framework 6.1, Part 3: Querying and Updating Trailer

Course at a glance

Included in these subscriptions:

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

Release date Release date 9/22/2014
Level Level Advanced
Runtime Runtime 2h 33m
Platform Platform Major browsers on Windows Major browsers on Windows Major browsers on Mac OSX Major browsers on Mac OSX Mobile Devices Mobile Devices
Closed captioning Closed captioning Included
Transcript Transcript Included
eBooks / courseware eBooks / courseware Included
Hands-on labs Hands-on labs N/A
Sample code Sample code N/A
Exams Exams Included

Enterprise Solutions
Enterprise Solutions

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

Course description

We’ll start this course by looking at LINQ to Entities, which lets you write SQL-like statements against entity objects using syntax built into C# and Visual Basic. Although you’re likely to use LINQ for every day application development with Entity Framework, you can also use Entity SQL, which is a powerful SQL-like querying language built into Entity Framework. Then, we’ll take a brief look at querying using the EntityClient API, which is a low-level option that lets you access raw data streams but requires you to materialize your own objects to receive the results. Next you’ll learn how to update existing entities, insert new entities, and delete entities, as well as get object state information.


This course assumes that you are experienced with relational database design and programming concepts. Entity Framework is all about data access, and the course doesn’t spend any time on data fundamentals. You’ll also need a good understanding of object-oriented programming in C#, so that you know how to use the entity data objects that Entity Framework generates from your data model. You’ll also need to have a working knowledge of Language INtegrated Queries (LINQ) in C#. The course uses Entity Framework with various SQL Server databases, so you should know enough about SQL Server to know how to perform various tasks and be able to connect to a database. But you don’t need deep knowledge of SQL Server to use Entity Framework productively. You should have already viewed the Entity Framework 6.1: Data Model course before taking this course.

Prepare for certification

This course will help you prepare for:
70-487 Developing Windows Azure and Web Services

This course will help you earn:
MCSD: Web Applications

Meet the expert

Don Kiely 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

Queries and LINQ

Overview of Query Options (17:20)
  • Introduction (00:49)
  • Entity Framework Query Options (02:35)
  • Architecture (00:24)
  • Building & Testing Queries (02:04)
  • Demo: LINQPad Setup (04:58)
  • Demo: LINQPad Queries & Expressions (05:44)
  • Summary (00:42)
Executing LINQ to Entities (16:33)
  • Introduction (00:32)
  • Demo: Navigation References (01:06)
  • Demo: Simple Query (02:29)
  • Demo: Debugging (02:09)
  • Demo: var keyword (01:36)
  • Demo: View Classes Diagram (04:32)
  • Demo: Exploring the Code (03:37)
  • Summary (00:28)
Introduction LINQ to Entities (23:08)
  • Introduction (00:43)
  • A LINQ Primer (04:14)
  • LINQ Query Expressions & Methods (07:20)
  • Demo:Expressions & Methods (04:38)
  • Demo: Methods (cont.) (03:42)
  • Which Syntax to Use? (01:48)
  • Summary (00:40)
LINQ to Entities-Projections (17:36)
  • Introduction (01:01)
  • Projections (00:51)
  • Demo: Projections (04:56)
  • Demo: Anonymous Type (05:27)
  • Demo: Properties (05:01)
  • Summary (00:18)

Entity Options

Querying Related (16:44)
  • Introduction (01:19)
  • Demo: Navigation References (04:51)
  • Demo: Navigation Collections (04:49)
  • Demo: Nav. Collections (cont.) (05:14)
  • Summary (00:29)
Aggregates and Grouping (12:41)
  • Introduction (00:33)
  • Demo: Aggregates (04:18)
  • Demo: Grouping (05:20)
  • Demo: Grouping (cont.) (01:58)
  • Summary (00:31)
Entity SQL (11:37)
  • Introduction (01:07)
  • Querying with Entity SQL (00:50)
  • Demo: Basic Entity SQL (01:47)
  • Basic Entity SQL Syntax (01:05)
  • VALUE Keyword (01:12)
  • Demo: Parameterized Query (02:52)
  • Canonical Functions (00:54)
  • Categories of Canonical Functs (01:08)
  • Summary (00:38)
Entity Client API (11:03)
  • Introduction (00:49)
  • Directly Querying EntityClient (00:50)
  • Demo: Direct Query (04:05)
  • Demo: A Little Tricky (04:49)
  • Summary (00:28)
Entities and Saving Data (26:34)
  • Introduction (00:47)
  • Updating Entities & Saving Data (03:02)
  • Demo: Updating Entities (05:12)
  • Demo: Using SQL Profiler (04:06)
  • Inserting New Entities (00:44)
  • Demo: Inserting New Entities (04:56)
  • Demo: Inserting New (cont.) (02:31)
  • Deleting Entities (01:16)
  • Demo: Deleting Entities (03:13)
  • Summary (00:41)