/// <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;
 }
Example #2
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));
 }