2024-12-21 15:30:17 +01:00
|
|
|
using DotBased.AspNet.Authority.Interfaces;
|
2024-12-23 01:26:21 +01:00
|
|
|
using DotBased.AspNet.Authority.Models.Options;
|
2024-12-21 15:30:17 +01:00
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
|
|
|
namespace DotBased.AspNet.Authority;
|
|
|
|
|
|
|
|
public static class AuthorityProviderExtensions
|
|
|
|
{
|
2024-12-23 01:26:21 +01:00
|
|
|
public static AuthorityBuilder AddAuthorityProvider<TModel>(this IServiceCollection services, Action<AuthorityOptions> optionsAction) where TModel : class
|
2024-12-21 15:30:17 +01:00
|
|
|
{
|
2024-12-23 01:26:21 +01:00
|
|
|
services.AddOptions();
|
|
|
|
// Configure required classes, services, etc.
|
|
|
|
services.Configure<AuthorityOptions>(optionsAction);
|
2024-12-21 15:30:17 +01:00
|
|
|
return new AuthorityBuilder(services);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static AuthorityBuilder AddAuthorityStore<TStore>(this AuthorityBuilder authorityBuilder) where TStore : IAuthorityRepository
|
|
|
|
{
|
|
|
|
return authorityBuilder;
|
|
|
|
}
|
2024-12-23 15:59:24 +01:00
|
|
|
|
|
|
|
public static AuthorityBuilder MapAuthorityEndpoints(this AuthorityBuilder builder)
|
|
|
|
{
|
|
|
|
return builder;
|
|
|
|
}
|
2024-12-21 15:30:17 +01:00
|
|
|
}
|