Create a DbContext class in Entity Framework Core

Published: 21 January 2024
on channel: Round The Code
16,678
157

🎯 Use Entity Framework Core to build real APIs with Minimal APIs:
👉 https://www.udemy.com/course/aspnet-c...

============

💻 Download the code example💻
👉 https://www.roundthecode.com/dotnet-c...

📖 Learn .NET and C# with our online courses 📖
👉 https://www.roundthecode.com/dotnet-c...

This tutorial will concentrate on setting up an Entity Framework DbContext class and SQL Server database for an ASP.NET Core Web API.

We'll show you how to install Visual Studio, the .NET SDK and LocalDB onto your machine.

From there, we will create the projects needed in Visual Studio and add the relevant EF Core NuGet packages.

Afterwards, we'll create the DbContext and the database that it's going to connect to and show you how you can check the database connection of a DbContext.

► This is part 1 of our Get started with EF Core course. View the full playlist:
   • Get started with EF Core - Full course  

► Connection string needed for the Web API
Server=(localdb)\\MSSQLLocalDB; Database=RoundTheCodeEFCore; Trusted_Connection=true; Trust Server Certificate=true; MultipleActiveResultSets=true; Integrated Security=true;

► Chapters
0:00 What we'll cover
0:13 Setup machine
1:48 Create projects in Visual Studio
3:20 Add Entity Framework NuGet packages
4:13 Create database
5:14 Create DbContext
6:00 Add DbContext to Web API
6:42 Test DbContext connection to the database
7:47 Learn more about EF Core

#efcore #entityframework #entityframeworkcore


On this page of the site you can watch the video online Create a DbContext class in Entity Framework Core with a duration of hours minute second in good quality, which was uploaded by the user Round The Code 21 January 2024, share the link with friends and acquaintances, this video has already been watched 16,678 times on youtube and it was liked by 157 viewers. Enjoy your viewing!