Update SurveyLib and moved all AddScoped to DI methods
This commit is contained in:
parent
d73e0a104f
commit
7ccf8cb018
4 changed files with 49 additions and 20 deletions
27
SurveyBackend/SurveyBackend.Services/DependencyInjection.cs
Normal file
27
SurveyBackend/SurveyBackend.Services/DependencyInjection.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue