Merge branch 'unstable' into 'main'
add DI method to infrastructure See merge request internship-2025/survey-webapp/surveylib!20
This commit is contained in:
commit
d9f16ee761
1 changed files with 19 additions and 0 deletions
19
SurveyLib.Infrastructure.EFCore/DependencyInjection.cs
Normal file
19
SurveyLib.Infrastructure.EFCore/DependencyInjection.cs
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue