Split Program.cs DI registrations into per-namespace DependencyRegistration classes
Each root namespace (Audit, Common, Data, Environments, Features/Usage, Identities, Organizations, Projects, Segments, Users, Webhooks) gets its own static DependencyRegistration class exposing an Add<Name>Services extension method, so Program.cs just wires them together instead of listing every registration inline.
This commit is contained in:
14
src/api/MicCheck.Api/Users/DependencyRegistration.cs
Normal file
14
src/api/MicCheck.Api/Users/DependencyRegistration.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
|
||||
namespace MicCheck.Api.Users;
|
||||
|
||||
public static class DependencyRegistration
|
||||
{
|
||||
public static IServiceCollection AddUsersServices(this IServiceCollection services)
|
||||
{
|
||||
services.AddScoped<UserService>();
|
||||
services.AddScoped<IPasswordHasher<User>, PasswordHasher<User>>();
|
||||
|
||||
return services;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user