Convert Auth module to MediatR command
Adds the MediatR package and wires AddMediatR in DI. Replaces IAuthService/AuthService with LoginCommand/LoginHandler, the pattern the remaining modules will follow.
This commit is contained in:
@@ -25,6 +25,7 @@ public static class DependencyInjection
|
||||
services.AddScoped<IUnitOfWork, UnitOfWork>();
|
||||
|
||||
services.AddAutoMapper(cfg => { }, typeof(MappingProfile).Assembly);
|
||||
services.AddMediatR(cfg => cfg.RegisterServicesFromAssembly(typeof(IUnitOfWork).Assembly));
|
||||
|
||||
services.AddScoped<IPasswordHasher, BcryptPasswordHasher>();
|
||||
|
||||
@@ -39,7 +40,6 @@ public static class DependencyInjection
|
||||
services.AddSingleton(jwtOptions);
|
||||
services.AddScoped<ITokenService, JwtTokenService>();
|
||||
|
||||
services.AddScoped<IAuthService, AuthService>();
|
||||
services.AddScoped<IAccountService, AccountService>();
|
||||
services.AddScoped<IPermissionService, PermissionService>();
|
||||
services.AddScoped<IRoleService, RoleService>();
|
||||
|
||||
Reference in New Issue
Block a user