DotBased/DotBased.AspNet.Authority/AuthorityProviderExtensions.cs

26 lines
902 B
C#
Raw Normal View History

2024-12-21 15:30:17 +01:00
using DotBased.AspNet.Authority.Interfaces;
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
{
public static AuthorityBuilder AddAuthorityProvider<TModel>(this IServiceCollection services, Action<AuthorityOptions> optionsAction) where TModel : class
2024-12-21 15:30:17 +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
}