ConnectionString in appsettings.json: Use in Entity Framework Core for SQL Server

Опубликовано: 09 Октябрь 2022
на канале: Round The Code
12,983
119

A connection string can be set in appsettings.json so a .NET application can integrate with SQL Server.

We'll show you how to set up a connection string in appsettings.json so it can be read in an ASP.NET Core web app.

The ConnectionString section can also be used with Entity Framework Core to communicate with a database.

As a result, it allows Entity Framework to be used in different parts of an application, such as a controller in a Web API, or in an MVC application.

We'll show you how to integrate EF Core with appsettings.json so it can communicate with SQL Server through a connection string. Our example will read data from the database, which will be shown with the output of a query from the DbContext.

This is part 2 of our appsettings.json course. The full playlist is here:
   • AppSettings.json course  

💻 Download the code example for this demo 💻
https://www.roundthecode.com/dotnet-c...

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

► Chapters
0:00 How ConnectionString is used in AppSettings.json
0:25 Learn .NET with our online courses
0:35 Add ConnectionString to AppSettings.json
0:55 SQL Server database used for example
1:11 Entity Framework DbContext setup
1:49 Add DbContext to Program.cs
2:55 Read the DbContext in an ASP.NET Core Web API
4:39 Preview of next part

#appsettings #connectionstring #entityframework


На этой странице сайта вы можете посмотреть видео онлайн ConnectionString in appsettings.json: Use in Entity Framework Core for SQL Server длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Round The Code 09 Октябрь 2022, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 12,983 раз и оно понравилось 119 зрителям. Приятного просмотра!