public AuthSeeder(IServiceProvider services) { //using (var scope = services.GetRequiredService<IServiceScopeFactory>().CreateScope()) //{ // this.roleManager = scope.ServiceProvider.GetRequiredService<RoleManager<IdentityRole>>(); // this.userManager = scope.ServiceProvider.GetRequiredService<UserManager<AppUser>>(); //} this.scope = services.GetRequiredService <IServiceScopeFactory>().CreateScope(); this.roleManager = scope.ServiceProvider.GetRequiredService <RoleManager <IdentityRole> >(); this.userManager = scope.ServiceProvider.GetRequiredService <UserManager <AppUser> >(); this.context = scope.ServiceProvider.GetRequiredService <WorkerCompanyPetContext>(); }
public AuthSeeder(RoleManager <IdentityRole> roleManager, UserManager <AppUser> userManager, WorkerCompanyPetContext context) { this.roleManager = roleManager; this.userManager = userManager; this.context = context; }
public CheckWorkersForUpdates(WorkerCompanyPetContext context, ISendEmail sendEmail, ILogger <CheckWorkersForUpdates> logger) { this.context = context; this.sendEmail = sendEmail; this.logger = logger; }