This repository has been archived on 2024-10-24. You can view files and clone it, but cannot push or open issues or pull requests.
NG_2023_Kanban/NG_2023_Kanban.DataLayer/DbStartup/Injecting.cs

23 lines
645 B
C#
Raw Normal View History

2023-05-16 22:09:57 +03:00
using NG_2023_Kanban.DataLayer.Service;
2023-05-11 23:20:46 +03:00
using Microsoft.EntityFrameworkCore;
2023-05-16 22:09:57 +03:00
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
2023-05-11 23:20:46 +03:00
2023-05-15 20:45:16 +03:00
namespace NG_2023_Kanban.DataLayer.DbStartup
2023-05-11 23:20:46 +03:00
{
public static class Injecting
{
2023-05-16 22:09:57 +03:00
public static void InjectDAL(
2023-05-11 23:20:46 +03:00
this IServiceCollection services,
IConfiguration configuration)
{
services.AddDbContext<DatabaseContext>(options =>
{
options.UseSqlServer(
configuration["ConnectionString"]);
});
2023-05-16 22:09:57 +03:00
services.AddScoped<DataService>();
2023-05-11 23:20:46 +03:00
}
}
}