Paths

Entity Framework 6

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 skill path covers EF 6, which is a mature and stable version of Entity Framework that runs on the full .NET Framework. This skill path takes you through getting started with EF 6 to advanced features. It also covers how to use EF Migrations to create and populate your databases as well as how to test your Entity Framework applications.... Read moreRead less

Related topics

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

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

Overview of Entity Framework 632m

Creating a Code Based Model and Database40m

Using EF to Interact with Your Data37m

Using EF in Your Applications47m

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

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

Overview of What's New in EF635m

Getting to EF619m

Performance and Stability Improvements50m

Changes to the EF Tooling43m

Stored Procedure Mappings for Code First22m

Custom Code First Conventions31m

More Code First Goodies41m

Enhancements to Code First Migrations54m

Improved Database Interaction36m

Code-Based DbContext Configurations and Interceptors56m

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

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

Course Overview1m

Architecting a Data Layer29m

Understanding EF Encapsulation and the Great Repository Debates21m

Implementing Encapsulation Patterns with Entity Framework46m

Managing Complex Domains and Data Models41m

Refactoring into Bounded Contexts: A Walkthrough27m

Handling the State of Disconnected Graphs14m

Mapping DDD Domain Models with EF51m

Testing Your Apps When Entity Framework Is Involved 46m

Entity Framework Migrations for Large Teams

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

Course Overview1m

Entity Framework Migrations for Large Teams19m

Following a Workflow38m

Handling Special Cases32m

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

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

Course Overview1m

The Importance of Testing the Data Access Layer12m

Deploying a Database to the Test Environment35m

Isolating Integration Tests16m

When and How to Unit Test52m

Structuring a Readable Test23m

Code-first Entity Framework with Legacy Databases

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

Introduction and Project Overview15m

Generating Code First Types from an Existing Database48m

Isolating the Relevant Database Objects15m

Organizing the Generated Code21m

Customizing the Generated Code31m

Working with Entity Framework Migrations19m

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.