/// <summary> /// Initializes a new instance of the <see cref="CloseAccountJob"/> class. /// </summary> /// <param name="configuration">The configuration to use.</param> /// <param name="logger">The logger to use.</param> /// <param name="profileDelegate">The profile delegate.</param> /// <param name="emailService">The email service.</param> /// <param name="authDelegate">The OAuth2 authentication service.</param> /// <param name="userAdminDelegate">The AccessManagement userAdmin delegate.</param> /// <param name="dbContext">The db context to use.</param> public CloseAccountJob( IConfiguration configuration, ILogger <CloseAccountJob> logger, IUserProfileDelegate profileDelegate, IEmailQueueService emailService, IAuthenticationDelegate authDelegate, IUserAdminDelegate userAdminDelegate, GatewayDbContext dbContext) { this.configuration = configuration; this.logger = logger; this.profileDelegate = profileDelegate; this.emailService = emailService; this.authDelegate = authDelegate; this.userAdminDelegate = userAdminDelegate; this.dbContext = dbContext; this.profilesPageSize = this.configuration.GetValue <int>($"{JobKey}:{ProfilesPageSizeKey}"); this.hoursBeforeDeletion = this.configuration.GetValue <int>($"{JobKey}:{HoursDeletionKey}") * -1; this.emailTemplate = this.configuration.GetValue <string>($"{JobKey}:{EmailTemplateKey}"); IConfigurationSection?configSection = configuration?.GetSection(AuthConfigSectionName); this.tokenUri = configSection.GetValue <Uri>(@"AuthTokenUri"); this.tokenRequest = new ClientCredentialsTokenRequest(); configSection.Bind(this.tokenRequest); }
/// <summary> /// Initializes a new instance of the <see cref="CloseAccountJob"/> class. /// </summary> /// <param name="configuration">The configuration to use.</param> /// <param name="logger">The logger to use.</param> /// <param name="profileDelegate">The profile delegate.</param> /// <param name="emailService">The email service.</param> /// <param name="authDelegate">The OAuth2 authentication service.</param> /// <param name="userAdminDelegate">The AccessManagement userAdmin delegate.</param> /// <param name="dbContext">The db context to use.</param> public CloseAccountJob( IConfiguration configuration, ILogger <CloseAccountJob> logger, IUserProfileDelegate profileDelegate, IEmailQueueService emailService, IAuthenticationDelegate authDelegate, IUserAdminDelegate userAdminDelegate, GatewayDbContext dbContext) { this.configuration = configuration; this.logger = logger; this.profileDelegate = profileDelegate; this.emailService = emailService; this.authDelegate = authDelegate; this.userAdminDelegate = userAdminDelegate; this.dbContext = dbContext; this.profilesPageSize = this.configuration.GetValue <int>($"{JobKey}:{ProfilesPageSizeKey}"); this.host = this.configuration.GetValue <string>($"{HostKey}"); this.hoursBeforeDeletion = this.configuration.GetValue <int>($"{JobKey}:{HoursDeletionKey}") * -1; this.emailTemplate = this.configuration.GetValue <string>($"{JobKey}:{EmailTemplateKey}"); }