using Microsoft.AspNetCore.Identity; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Options; using System; using System.Collections.Generic; using System.Security.Claims; using System.Security.Principal; using System.Text; using System.Threading.Tasks; namespace MTWorkHR.Identity.Models { public static class IdentityExtensions { public static IdentityBuilder AddSecondIdentity( this IServiceCollection services) where TUser : class where TRole : class { services.TryAddScoped, UserValidator>(); services.TryAddScoped, PasswordValidator>(); services.TryAddScoped, PasswordHasher>(); services.TryAddScoped, RoleValidator>(); services.TryAddScoped>(); services.TryAddScoped, UserClaimsPrincipalFactory>(); services.TryAddScoped, AspNetUserManager>(); services.TryAddScoped, SignInManager>(); services.TryAddScoped, AspNetRoleManager>(); services.TryAddScoped, DefaultUserConfirmation>(); return new IdentityBuilder(typeof(TUser), typeof(TRole), services); } } }