Entity Framework Core 2: Getting Started

This course helps those with experience in earlier versions of EF and EF Core, and developers completely new to Entity Framework. Learn how to build data models with EF Core and use EF Core to let your software interact with data in your databases.
Course info
Rating
(127)
Level
Beginner
Updated
Feb 6, 2018
Duration
2h 42m
Table of contents
Course Overview
Introducing a New, Lighter Weight Version of EF
Creating a Data Model and Database with EF Core
Interacting with Your EF Core Data Model
Querying and Saving Related Data
Using EF Core in Your Applications
Description
Course info
Rating
(127)
Level
Beginner
Updated
Feb 6, 2018
Duration
2h 42m
Description

Entity Framework Core 2 is the newest version of Microsoft's O/RM for performing database persistence in .NET-based software. EF Core is a lightweight and extensible version of Entity Framework that has been written from the ground up. Whether you are new to EF Core or looking to see how to shift your earlier EF experience to EF Core, this course can help you get started. First, you'll learn how to define an EF Core data model to act as a bridge between your .NET objects and your database. You'll then learn how to interact with the data model using EF Core's various APIs. Finally, you'll be shown how to incorporate this model into a desktop application based on the .NET Framework and a cross-platform ASP.NET Core MVC application. By the end of this course, you will be able to build .NET framework, or .NET Core software using EF Core 2. All coding will be done in Visual Studio 2017 in a Windows environment.

About the author
About the author

Julie Lerman is a Microsoft MVP, .NET mentor and consultant who lives in the hills of Vermont. You can find Julie presenting on data access and other Microsoft .NET topics at user groups and conferences around the world. Julie is the author of the highly acclaimed "Programming Entity Framework (with a second edition coming soon) and authors the MSDN Magazine Data Points column.

More from the author
Entity Framework Core 2: Mappings
Intermediate
1h 59m
16 May 2018
More courses by Julie Lerman
Section Introduction Transcripts
Section Introduction Transcripts

Course Overview
Welcome to Pluralsight. My name is Julie Lerman, and you may know me as one of the most recognized authorities in the world on Entity Framework, Microsoft's data access platform for. NET development. I'm so excited to share with you the newest version of Entity Framework Core. EF Core 2 brings back more of the features many developers depended on in earlier versions of EF, as well as new innovations beyond that first iteration of EF Core, it's the version that finally feels ready to many developers and businesses who were originally reluctant to try out EF Core. If you're already using Entity Framework or that first version of EF Core, this course will help you learn how to leverage your existing EF knowledge to quickly get up to speed with EF Core 2. If you're brand new to EF, you'll learn the basics and get insights that will take you further than a standard baby steps lesson. Whether you're building software for Windows or cross platform apps for. NET Core, this course will give you an understanding of the variety of environments where you can build and deploy apps that use EF Core 2. You'll learn how to build and interact with data models and then build a desktop app and a cross platform ASP. NET Core app that use EF Core 2 for their data access. While this course will use a familiar environment, Visual Studio 2017 on Windows, everything you learn here will apply to any of the environments where you can build. NET Framework or. NET Core software. I hope you'll join me on this journey as you get quickly up to speed on using Entity Framework Core 2.

Creating a Data Model and Database with EF Core
Hello. I'm Julie Lerman, and welcome back to Entity Framework Core 2: Getting Started. In this module, we'll dive into Visual Studio 2017 to build your first EF Core data model. We'll start by setting up a solution and some full. NET Framework projects to host the business classes and the EF Core 2 data access. Then we'll add EF Core 2 into the data access project and build up a data model using its APIs. Once the data model has been created, you'll learn how to use EF Core migrations to create a database from the model or just generate SQL scripts so you can create the database when you're ready. With the first model created, we'll recreate it, and a little faster this time in a solution for a cross-platform ASP. NET Core project. Then we'll modify the model adding in some more complicated relationships, a many-to-many and a one-to-one, to see how EF Core 2 translates them to the database. We'll migrate the database a second time to apply those model changes, and when we're all done, you'll have classes, a database, and an EF Core 2 power data layer to start coding with.

Interacting with Your EF Core Data Model
Hello. Welcome back to Entity Framework Core 2: Getting Started. I'm Julie Lerman, and now it's time to learn about interacting with data in your database using EF Core 2 and the data model that we've already built. In this module, we'll focus on interacting with simple objects and then followup in the next module by adding in relationships. You'll start by learning how to insert, update, and delete data using the DbContext and your data model. We'll check out the batch support that EF Core has for data modification commands going to the database, and once there is some data in the database, you'll then learn how to use EF Core and LINQ to write and execute queries, including various ways to filter what data is returned from the database. The way EF Core comprehends the state of objects is affected when you're working in disconnected applications like websites or Web APIs of even loosely coupled applications, I'll make sure that you understand how to ensure EF Core does the right thing to your data. Before getting started, I'll show you how to use EF Core's logging capabilities so that we'll be able to watch what kind of SQL is getting sent to the database. So let's get started.

Querying and Saving Related Data
Hello. I'm Julie Lerman. Welcome back to Entity Framework Core 2: Getting Started. This module focuses on interacting with related data that's in your database. Now that you've learned how to insert, update, and delete simple objects, you'll now discover how to do the same with data that's across relationships. It's easier to make these changes when EF Core is tracking your objects, but it's also really important to understand how to let EF Core know what to do with objects that it hasn't been tracking. You'll also learn about querying related data by including it in queries for the parent data or after the parent data is already in memory. I'll teach you how you can shape query results using projection queries. And finally, you'll see how you can navigate through relationships when building queries, as well as filtering and sorting data. So let's get started.

Using EF Core in Your Applications
Hello, I'm Julie Lerman. Welcome back to Entity Framework Core 2: Getting Started. In those final module, you'll get a chance to use EF Core in some actual applications, not just a test console. There are so many places you can use EF Core now, and not just limited to Windows. But I can't demonstrate them all. So I'll start with a rundown on where it can be used and some of the things to keep in mind across different clients. Then we'll dive into a Windows desktop application, and I'll use WPF for this demo. An important lesson in the desktop application will be about designing your EF Core data access for these types of connected scenarios, when EF Core is able to keep track of objects while they're being edited in the user interface. Then we'll switch to using EF Core in an ASP. NET Core application. We already created the beginnings of an MVC app earlier in this course, so I'll start by adding a controller and some views to that solution to see what the templates can do for you. And then I'll show you how to make the MVC app more friendly to users by enhancing the template generated code in order to retrieve, present, and persist related data. So, let's get started.