public static AbpIdentityBuilder AddAbpSignInManager <TSignInManager>(this AbpIdentityBuilder builder) where TSignInManager : class { var abpManagerType = typeof(AbpSignInManager <, ,>).MakeGenericType(builder.TenantType, builder.RoleType, builder.UserType); var managerType = typeof(SignInManager <>).MakeGenericType(builder.UserType); builder.Services.AddScoped(abpManagerType, services => services.GetRequiredService(managerType)); builder.AddSignInManager <TSignInManager>(); return(builder); }
public static AbpIdentityBuilder AddAbpLogInManager <TLogInManager>(this AbpIdentityBuilder builder) where TLogInManager : class { var type = typeof(TLogInManager); var abpManagerType = typeof(AbpLogInManager <, ,>).MakeGenericType(builder.TenantType, builder.RoleType, builder.UserType); builder.Services.AddScoped(type, provider => provider.GetService(abpManagerType)); builder.Services.AddScoped(abpManagerType, type); return(builder); }
public static AbpIdentityBuilder AddAbpEditionManager <TEditionManager>(this AbpIdentityBuilder builder) where TEditionManager : class { var type = typeof(TEditionManager); var abpManagerType = typeof(AbpEditionManager); builder.Services.AddScoped(type, provider => provider.GetRequiredService(abpManagerType)); builder.Services.AddScoped(abpManagerType, type); return(builder); }
public static AbpIdentityBuilder AddAbpTenantManager <TTenantManager>(this AbpIdentityBuilder builder) where TTenantManager : class { var type = typeof(TTenantManager); var abpManagerType = typeof(AbpTenantManager <,>).MakeGenericType(builder.TenantType, builder.UserType); builder.Services.AddTransient(type, provider => provider.GetService(abpManagerType)); builder.Services.AddTransient(abpManagerType, type); return(builder); }
public static AbpIdentityBuilder AddFeatureValueStore <TFeatureValueStore>(this AbpIdentityBuilder builder) where TFeatureValueStore : class { var type = typeof(TFeatureValueStore); var storeType = typeof(AbpFeatureValueStore <,>).MakeGenericType(builder.TenantType, builder.UserType); builder.Services.AddScoped(type); builder.Services.AddScoped(storeType, provider => provider.GetService(type)); builder.Services.AddScoped(typeof(IFeatureValueStore), provider => provider.GetService(type)); return(builder); }
public static AbpIdentityBuilder AddPermissionChecker <TPermissionChecker>(this AbpIdentityBuilder builder) where TPermissionChecker : class { var type = typeof(TPermissionChecker); var checkerType = typeof(PermissionChecker <,>).MakeGenericType(builder.RoleType, builder.UserType); builder.Services.AddScoped(type); builder.Services.AddScoped(checkerType, provider => provider.GetService(type)); builder.Services.AddScoped(typeof(IPermissionChecker), provider => provider.GetService(type)); return(builder); }
public static AbpIdentityBuilder AddAbpRoleStore <TRoleStore>(this AbpIdentityBuilder builder) where TRoleStore : class { var type = typeof(TRoleStore); var abpStoreType = typeof(AbpRoleStore <,>).MakeGenericType(builder.RoleType, builder.UserType); var storeType = typeof(IRoleStore <>).MakeGenericType(builder.RoleType); builder.Services.AddScoped(type); builder.Services.AddScoped(abpStoreType, services => services.GetRequiredService(type)); builder.Services.AddScoped(storeType, services => services.GetRequiredService(type)); return(builder); }
public static AbpIdentityBuilder AddAbpSecurityStampValidator <TSecurityStampValidator>(this AbpIdentityBuilder builder) where TSecurityStampValidator : class, ISecurityStampValidator { var type = typeof(TSecurityStampValidator); builder.Services.AddScoped(typeof(SecurityStampValidator <>).MakeGenericType(builder.UserType), services => services.GetRequiredService(type)); builder.Services.AddScoped(typeof(AbpSecurityStampValidator <, ,>).MakeGenericType(builder.TenantType, builder.RoleType, builder.UserType), services => services.GetRequiredService(type)); builder.Services.AddScoped(typeof(ISecurityStampValidator), services => services.GetRequiredService(type)); builder.Services.AddScoped(type); return(builder); }
public static AbpIdentityBuilder AddAbpUserClaimsPrincipalFactory <TUserClaimsPrincipalFactory>(this AbpIdentityBuilder builder) where TUserClaimsPrincipalFactory : class { var type = typeof(TUserClaimsPrincipalFactory); builder.Services.AddScoped(typeof(UserClaimsPrincipalFactory <,>).MakeGenericType(builder.UserType, builder.RoleType), services => services.GetRequiredService(type)); builder.Services.AddScoped(typeof(AbpUserClaimsPrincipalFactory <,>).MakeGenericType(builder.UserType, builder.RoleType), services => services.GetRequiredService(type)); builder.Services.AddScoped(typeof(IUserClaimsPrincipalFactory <>).MakeGenericType(builder.UserType), services => services.GetRequiredService(type)); builder.Services.AddScoped(type); return(builder); }