Exemplo n.º 1
0
 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>();
 }
Exemplo n.º 2
0
 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;
 }