/// <summary> /// Initializes a new instance of the <see cref="CommunicationJob"/> class. /// </summary> /// <param name="configuration">The configuration to use.</param> /// <param name="logger">The logger to use.</param> /// <param name="communicationDelegate">The Communication delegate to use.</param> /// <param name="commEmailDelegate">The Communication Email delegate to use.</param> /// <param name="emailQueueService">The email queue service to use.</param> /// <param name="dbContext">The db context to use.</param> public CommunicationJob(IConfiguration configuration, ILogger <CommunicationJob> logger, ICommunicationDelegate communicationDelegate, ICommunicationEmailDelegate commEmailDelegate, IEmailQueueService emailQueueService, GatewayDbContext dbContext) { this.configuration = configuration; this.logger = logger; this.communicationDelegate = communicationDelegate; this.commEmailDelegate = commEmailDelegate; this.emailQueueService = emailQueueService; this.dbContext = dbContext; IConfigurationSection commEmailJobSection = this.configuration.GetSection("CreateCommEmailsForNewCommunications"); this.fromEmailAddressHGDonotreply = commEmailJobSection.GetValue <string>("FromEmailAddressHGDonotreply"); this.maxFetchSize = commEmailJobSection.GetValue <int>("MaxFetchSize", 250); }
/// <summary> /// Initializes a new instance of the <see cref="CommunicationService"/> class. /// </summary> /// <param name="logger">Injected Logger Provider.</param> /// <param name="communicationDelegate">The communication delegate to interact with the DB.</param> public CommunicationService(ILogger <CommunicationService> logger, ICommunicationDelegate communicationDelegate) { this.logger = logger; this.communicationDelegate = communicationDelegate; }
/// <summary> /// Initializes a new instance of the <see cref="CommunicationService"/> class. /// </summary> /// <param name="logger">Injected Logger Provider.</param> /// <param name="communicationDelegate">Injected Note delegate.</param> /// <param name="memoryCache">The cache to use to reduce lookups.</param> public CommunicationService(ILogger <CommunicationService> logger, ICommunicationDelegate communicationDelegate, IMemoryCache memoryCache) { this.logger = logger; this.communicationDelegate = communicationDelegate; this.memoryCache = memoryCache; }