Тёмный

Create a DbContext class in Entity Framework Core 

Round The Code
Подписаться 9 тыс.
Просмотров 6 тыс.
50% 1

Опубликовано:

 

30 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 6   
@aanders0n
@aanders0n 9 месяцев назад
Is there any difference in using createScope instead of (builder service.AddDbcontect method)?
@RoundTheCode
@RoundTheCode 9 месяцев назад
They are two different things. AddDbContext adds your DbContext to the service collection. CreateScope creates a new scope in the IoC container. By default, a DbContext gets added as a scoped service lifetime in dependency injection, so you have to create a custom scope if you want to resolve your DbContext outside of a HTTP request. This is what we are doing to check the connection of the database because the application isn't running at this point. Check out my LinkedIn course on dependency injection to learn more about it. www.roundthecode.com/dotnet-courses
@10Totti
@10Totti 9 месяцев назад
Thanks!
@RoundTheCode
@RoundTheCode 9 месяцев назад
You're welcome.
@JMB995
@JMB995 9 месяцев назад
Thank Youuuuu
@RoundTheCode
@RoundTheCode 9 месяцев назад
You're welcome.
Далее
Entity Framework Core migrations: Add a migration
10:00
Voy shetga man aralashay | Million jamoasi
00:56
Просмотров 544 тыс.
Configuring Entity Framework Code First [2 of 3]
24:06
xUnit tutorial: How to run unit testing in C#
10:34
Просмотров 1 тыс.
The Ultimate .NET Developer Roadmap in 2024
11:09
Просмотров 256 тыс.
Getting Started with Dapper in .NET
11:29
Просмотров 13 тыс.