add DI method to infrastructure

This commit is contained in:
Вячеслав 2025-05-31 01:31:54 +05:00
parent 8790e7c7cf
commit 88f98707fa

View file

@ -0,0 +1,19 @@
using Microsoft.Extensions.DependencyInjection;
using SurveyLib.Core.Repositories;
using SurveyLib.Infrastructure.EFCore.Repositories;
namespace SurveyLib.Infrastructure.EFCore;
public static class DependencyInjection
{
public static IServiceCollection AddSurveyLibInfrastructure(this IServiceCollection services)
{
services.AddScoped<ISurveyRepository, SurveyRepository>();
services.AddScoped<IQuestionRepository, QuestionRepository>();
services.AddScoped<IAnswerVariantsRepository, AnswerVariantsRepository>();
services.AddScoped<ICompletionRepository, CompletionRepository>();
services.AddScoped<IAnswerRepository, AnswerRepository>();
return services;
}
}