コード例 #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>();
 }
コード例 #2
0
 public AuthSeeder(RoleManager <IdentityRole> roleManager, UserManager <AppUser> userManager, WorkerCompanyPetContext context)
 {
     this.roleManager = roleManager;
     this.userManager = userManager;
     this.context     = context;
 }
コード例 #3
0
 public CheckWorkersForUpdates(WorkerCompanyPetContext context, ISendEmail sendEmail, ILogger <CheckWorkersForUpdates> logger)
 {
     this.context   = context;
     this.sendEmail = sendEmail;
     this.logger    = logger;
 }