コード例 #1
0
ファイル: Worker.cs プロジェクト: Hararr1/KleinMapBackend
 public Worker(
     ILogger <Worker> logger,
     ISMTPClient smtpClient,
     IDatabaseClient databaseClient,
     IMailTemplateManager mailTemplateManager,
     IConfiguration configuration)
 {
     _logger              = logger;
     _smtpClient          = smtpClient;
     _databaseClient      = databaseClient;
     _mailTemplateManager = mailTemplateManager;
     _configuration       = configuration;
 }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EmailManager"/> class.
 /// </summary>
 /// <param name="configuration">An instance of <see cref="IConfiguration"/>.</param>
 /// <param name="repositoryFactory">An instance of <see cref="IRepositoryFactory"/>.</param>
 /// <param name="logger">Instance of Logger.</param>
 /// <param name="templateManager">Instance of templateManager.</param>
 /// <param name="templateMerge">Instance of templateMerge.</param>
 public EmailManager(
     IConfiguration configuration,
     IRepositoryFactory repositoryFactory,
     ILogger logger,
     IMailTemplateManager templateManager,
     ITemplateMerge templateMerge)
 {
     this.repositoryFactory           = repositoryFactory;
     this.configuration               = configuration;
     this.emailNotificationRepository = repositoryFactory.GetRepository(Enum.TryParse <StorageType>(this.configuration?[Constants.StorageType], out this.repo) ? this.repo : throw new Exception());
     this.logger          = logger;
     this.templateManager = templateManager;
     this.templateMerge   = templateMerge;
 }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NotificationReportManager"/> class.
 /// </summary>
 /// <param name="logger">The logger.</param>
 /// <param name="repositoryFactory">The repository factory.</param>
 /// <param name="configuration">The configuration.</param>
 /// <param name="mailTemplateRepository">The mail template repository.</param>
 /// <param name="templateManager">The template manager.</param>
 /// <param name="templateMerge">The template merge.</param>
 /// <exception cref="Exception">Unknown Database Type.</exception>
 /// <exception cref="System.ArgumentNullException">mailTemplateRepository.</exception>
 public NotificationReportManager(
     ILogger logger,
     IRepositoryFactory repositoryFactory,
     IConfiguration configuration,
     IMailTemplateRepository mailTemplateRepository,
     IMailTemplateManager templateManager,
     ITemplateMerge templateMerge)
 {
     this.logger        = logger;
     this.configuration = configuration;
     this.emailNotificationRepository = repositoryFactory?.GetRepository(Enum.TryParse <StorageType>(this.configuration?[ConfigConstants.StorageType], out this.repo) ? this.repo : throw new Exception("Unknown Database Type"));
     this.templateManager             = templateManager;
     this.templateMerge          = templateMerge;
     this.mailTemplateRepository = mailTemplateRepository ?? throw new System.ArgumentNullException(nameof(mailTemplateRepository));
 }
コード例 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EmailController"/> class.
 /// </summary>
 /// <param name="emailHandlerManager">An instance of <see cref="EmailManager"/>.</param>
 /// <param name="templateManager">An instance of <see cref="MailTemplateManager"/>.</param>
 /// <param name="logger">An instance of <see cref="ILogger"/>.</param>
 /// <param name="correlationProvider">An instance of <see cref="ICorrelationProvider"/>.</param>
 public EmailController(IEmailHandlerManager emailHandlerManager, IMailTemplateManager templateManager, ILogger logger)
     : base(logger)
 {
     this.emailHandlerManager = emailHandlerManager ?? throw new System.ArgumentNullException(nameof(emailHandlerManager));
     this.templateManager     = templateManager ?? throw new ArgumentNullException(nameof(templateManager));
 }