2025-02-02 01:06:36 +01:00
|
|
|
using DotBased.AspNet.Authority.EFCore.Repositories;
|
|
|
|
using DotBased.AspNet.Authority.Repositories;
|
2025-02-01 01:02:27 +01:00
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
|
|
|
namespace DotBased.AspNet.Authority.EFCore;
|
|
|
|
|
|
|
|
public static class DI
|
|
|
|
{
|
|
|
|
public static IServiceCollection AddAuthorityContext(this IServiceCollection services, Action<DbContextOptionsBuilder> options)
|
|
|
|
{
|
|
|
|
services.AddDbContextFactory<AuthorityContext>(options);
|
2025-02-02 01:06:36 +01:00
|
|
|
services.AddScoped<IAttributeRepository, AttributeRepository>();
|
|
|
|
services.AddScoped<IGroupRepository, GroupRepository>();
|
|
|
|
services.AddScoped<IRoleRepository, RoleRepository>();
|
|
|
|
services.AddScoped<IUserRepository, UserRepository>();
|
2025-02-01 01:02:27 +01:00
|
|
|
return services;
|
|
|
|
}
|
|
|
|
}
|