Update SurveyLib and moved all AddScoped to DI methods

This commit is contained in:
Вячеслав 2025-05-31 01:32:50 +05:00
parent d73e0a104f
commit 7ccf8cb018
4 changed files with 49 additions and 20 deletions

View file

@ -0,0 +1,27 @@
using Microsoft.Extensions.DependencyInjection;
using SurveyBackend.Core.Services;
using SurveyBackend.Services.Helpers;
using SurveyBackend.Services.Services;
using SurveyLib.Core.Services;
namespace SurveyBackend.Services;
public static class DependencyInjection
{
public static IServiceCollection AddSurveyBackendServices(this IServiceCollection services)
{
services.AddScoped<IUserService, UserService>();
services.AddScoped<IPasswordHasher, Sha256PasswordHasher>();
services.AddScoped<IAuthorizationService, AuthorizationService>();
services.AddScoped<ISurveyService, SurveyService>();
services.AddScoped<IQuestionService, QuestionService>();
services.AddScoped<IAnswerVariantsService, AnswerVariantsService>();
services.AddScoped<ICompletionService, CompletionService>();
services.AddScoped<IAnswerService, AnswerService>();
return services;
}
}