Reimplementing Authorization system

This commit is contained in:
max
2024-12-01 03:13:55 +01:00
parent eb277e0937
commit 4580c5f5dc
31 changed files with 250 additions and 4 deletions

View File

@@ -0,0 +1,34 @@
using DotBased.ASP.Authentication.Configuration;
using DotBased.ASP.Authentication.Repositories;
using Microsoft.Extensions.DependencyInjection;
namespace DotBased.ASP.Authentication;
public static class BasedAuthenticationExtensions
{
public static BasedAuthenticationBuilder AddBasedAuthentication(this IServiceCollection services, Action<AuthenticationConfiguration>? configurationAction)
{
/*
* Add services
* - Validators
* - Managers
* - Services
*/
if (configurationAction != null)
{
services.Configure(configurationAction);
}
return new BasedAuthenticationBuilder(typeof(BasedAuthenticationBuilder));
}
public static BasedAuthenticationBuilder AddRepository<TRepository>(this BasedAuthenticationBuilder builder)
{
return builder;
}
public static BasedAuthenticationBuilder SeedData<TRepository>(this BasedAuthenticationBuilder builder, Action<TRepository> seeder) where TRepository : RepositoryBase
{
return builder;
}
}