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
Stanislav Mykhailenko 90db952f0c
Partially redo roles
2023-05-22 19:52:34 +03:00

29 lines
1.1 KiB
C#
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using NG_2023_Kanban.DataLayer.Repositories;
using NG_2023_Kanban.DataLayer.Interfaces;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
namespace NG_2023_Kanban.DataLayer.DbStartup
{
public static class Injecting
{
public static void InjectDAL(
this IServiceCollection services,
IConfiguration configuration)
{
services.AddTransient<IBoardRepository, BoardRepository>();
services.AddTransient<ICardRepository, CardRepository>();
services.AddTransient<IColumnRepository, ColumnRepository>();
services.AddTransient<ICommentRepository, CommentRepository>();
services.AddTransient<IRoleRepository, RoleRepository>();
services.AddTransient<IUserRepository, UserRepository>();
services.AddDbContext<DatabaseContext>(options =>
{
options.UseSqlServer(
configuration["ConnectionString"]);
});
}
}
}