Paths

Entity Framework 6

Authors: Simon Hughes, Julie Lerman, Michael Perry

Entity Framework (EF) is Microsoft's Object Relational Mapping (ORM) tool for the .NET framework that allows you to rapidly create a data access layer for your applications. This... Read more

Beginner

You will want to start by getting a handle on everything that Entity Framework 6 can do. The courses in this section will guide you from just starting out with Entity Framework to the use of its most advanced features, regardless of if you have used an ORM before or not.

Getting Started with Entity Framework 6

by Julie Lerman

Jul 31, 2015 / 2h 37m

2h 37m

Start Course
Description

If you are new to Entity Framework, Microsoft’s framework for integrating data access into your .NET applications, this is the place to start. You will gain an understanding of what EF is for, how it works, where it belongs in your software architecture, and how to get it there. You’ll gain hands on experience with the basics of using EF from designing a simple model to interacting with that to persist data from your application. In addition to getting developers started with EF and prepared to learn and take advantage of more advanced techniques, this course will provide managers with the info they need to help them with decision making when planning a development stack. We’ll be using Visual Studio 2015 and .NET 4.6 for demos.

Table of contents
  1. Overview of Entity Framework 632m
  2. Creating a Code Based Model and Database40m
  3. Using EF to Interact with Your Data37m
  4. Using EF in Your Applications47m

Entity Framework 6: Ninja Edition - What's New in EF6

by Julie Lerman

Nov 8, 2014 / 7h 12m

7h 12m

Start Course
Description

Entity Framework 6 brings major improvements to EF that allow developers to align their data access with advanced software practices. The biggest news for EF6 is that it is open-source and has gained a lot from developer community input. Features with broad appeal such as stored procedure mapping in code first, support for the Async/Await pattern when executing queries and commands, simpler patterns for unit testing, and built-in database logging capabilities have gotten a lot of visibility. EF6 is now very extensible with custom Migrations, custom mapping conventions, and the introduction of Dependency Injection patterns to open up low-level DbContext configuration. There are new methods and properties that allow simpler and smarter coding patterns. Rather than present a high level list of the new features, this course dives into each new feature in EF6, ensures that you understand not only what it is for, but how it works, scenarios where you can benefit from it, and gotchas you should watch out for. This course provides a comprehensive look at what EF6 adds to Entity Framework, and it will leave you with the ability to truly benefit from all of the Ninja power that's been added to this version of EF.

Table of contents
  1. Overview of What's New in EF635m
  2. Getting to EF619m
  3. Performance and Stability Improvements50m
  4. Changes to the EF Tooling43m
  5. Stored Procedure Mappings for Code First22m
  6. Custom Code First Conventions31m
  7. More Code First Goodies41m
  8. Enhancements to Code First Migrations54m
  9. Improved Database Interaction36m
  10. Code-Based DbContext Configurations and Interceptors56m
  11. Sometimes It's the Little Things38m

Intermediate

As you continue your journey with Entity Framework, you will want a comprehensive understanding of how it to integrate EF into your enterprise applications and use it across teams. The courses in this section will teach you how to design and build robust data access layers that use time-tested and proven patterns. You will also learn how to use Entity Framework Migrations to manage the structure of your database in a team based environment, allowing you to rapidly evolve your database schema as your needs change.

Entity Framework in the Enterprise

by Julie Lerman

Sep 23, 2016 / 4h 42m

4h 42m

Start Course
Description

Have you reached the limitation of the introductory lessons on Entity Framework when trying to implement EF into your real world business solutions? In this course, Entity Framework in the Enterprise, you will learn advanced patterns for incorporating Entity Framework into enterprise level architecture. First, you'll learn patterns for encapsulating your EF logic and how to choose which best suits your needs depending on what you need to accomplish. Next, discover how to align your EF code with the many beneficial patterns, from Domain-Driven Design in your software from breaking data models apart for Bounded Contexts, to persisting tightly-controlled aggregates. Finally, testing code without hitting the database gets easier with the test mock support introduced in EF6. You'll also get to see how to mock a variety of EF database interactions that are triggered by your business logic. When you're finished with this advanced Entity Framework course, you'll not only better understand using EF in your real-world software, but you may gain some general software architecture wisdom along the way. Software required: Visual Studio 2013 or higher, Entity Framework 6 or higher.

Table of contents
  1. Course Overview1m
  2. Architecting a Data Layer29m
  3. Understanding EF Encapsulation and the Great Repository Debates21m
  4. Implementing Encapsulation Patterns with Entity Framework46m
  5. Managing Complex Domains and Data Models41m
  6. Refactoring into Bounded Contexts: A Walkthrough27m
  7. Handling the State of Disconnected Graphs14m
  8. Mapping DDD Domain Models with EF51m
  9. Testing Your Apps When Entity Framework Is Involved 46m

Entity Framework Migrations for Large Teams

by Michael Perry

Aug 16, 2016 / 1h 51m

1h 51m

Start Course
Description

Entity Framework (EF) is the preferred mechanism for accessing a SQL database in an enterprise application. EF migrations keep the schema of the database in sync with the application. But when teams use EF migrations collaboratively, some challenges emerge. In this course, Entity Framework Migrations for Large Teams, you'll Learn how to use EF Migrations with Git and TFS source control. First, you'll learn to use Entity Framework Migrations with Git or TFS version control. Next, you'll learn to manage simple and complex database changes. Finally, you'll learn how to discover and resolve migration issues. By the end of this course you'll learn all of the techniques required in order to work better together with your team.

Table of contents
  1. Course Overview1m
  2. Entity Framework Migrations for Large Teams19m
  3. Following a Workflow38m
  4. Handling Special Cases32m
  5. Resolving Common Problems19m

Advanced

Testing is a critical component in the lifecycle of any application, so in this section, you will learn what it takes to properly test you Entity Framework applications. You will also learn about some available tooling specifically designed for working with existing databases and how it can simplify the use of EF with these databases. When finished with this path, you will have a thorough knowledge of all of Entity Framework's capabilities and how to use it in all of your applications.

Integration Testing of Entity Framework Applications

by Michael Perry

May 11, 2017 / 2h 21m

2h 21m

Start Course
Description

Having a good integration test suite is your greatest asset. In this course, Integration Testing of Entity Framework Applications, you'll learn that a good integration test suite is the best way to ensure the quality of your Entity Framework application. First, you'll set up a Continuous Integration server to rebuild a database and run all integration tests on every checkin. Next, you'll keep your test readable and resilient to change, so that they help you implement new features rather than hold you back. Finally, you'll find the balance between unit tests and integration tests so that you use the best technique in every case. After this course, you'll know that by investing in a quality test suite you'll increase both velocity and quality.

Table of contents
  1. Course Overview1m
  2. The Importance of Testing the Data Access Layer12m
  3. Deploying a Database to the Test Environment35m
  4. Isolating Integration Tests16m
  5. When and How to Unit Test52m
  6. Structuring a Readable Test23m

Code-first Entity Framework with Legacy Databases

by Simon Hughes

May 16, 2016 / 2h 52m

2h 52m

Start Course
Description

With EDMX support fading away, it's even more important to use code-first as EF7 approaches. Most generators are rigid and don't provide you any flexibility in how the code is to be generated. But in this course, Code-first Entity Framework with Legacy Databases, we will be using the "Entity-Framework Reverse POCO Generator", a free visual studio tool, available at www.ReversePoco.com. This generator has been designed from the ground up to be customizable, and produce the code you would have done if you hand-coded it yourself. This course will show you what each of the various settings has on the generated code, and you'll also learn how to create separate data and model projects, as well as create repositories, unit tests and integration tests. By the end of this course, you will be able to flexibly generate code that meets your needs.

Table of contents
  1. Introduction and Project Overview15m
  2. Generating Code First Types from an Existing Database48m
  3. Isolating the Relevant Database Objects15m
  4. Organizing the Generated Code21m
  5. Customizing the Generated Code31m
  6. Working with Entity Framework Migrations19m
  7. Testing the Code-first Access Layer19m

What you will learn

  • Creating Code-first based models to represent your database entities
  • Use of the DbContext class
  • Mapping database tables to EF model classes
  • Retrieving and updating data using EF
  • Using EF Migrations to create and manage your database schema
  • Using Domain-Driven Design Concepts with Entity Framework
  • Integration testing of Entity Framework
  • Reverse engineering a database to an Entity Framework model

Pre-requisites

You should have a working knowledge of the C# language and of SQL databases to start this path.