fix(EnvelopeMailService): Vermeiden Sie gemeinsam genutzte veränderbare Zustände in EnvelopeMailService-Platzhaltern
EnvelopeMailService wurde umgestaltet, um gemeinsam genutzte Veränderungen des _placeholders-Wörterbuchs zu vermeiden. Die Konfigurationseigenschaft MailParams.Placeholders wurde von einem veränderbaren Dictionary<string, string> zu einem ImmutableDictionary<string, string> geändert, und _placeholders wird nun bei der Dienstkonstruktion als neues Wörterbuch instanziiert.
This commit is contained in:
parent
286e17a900
commit
c7d26a87b0
@ -1,4 +1,6 @@
|
||||
namespace EnvelopeGenerator.Application.Configurations;
|
||||
using System.Collections.Immutable;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Configurations;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
@ -8,5 +10,5 @@ public class MailParams
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public required Dictionary<string, string> Placeholders { get; init; }
|
||||
public required ImmutableDictionary<string, string> Placeholders { get; init; }
|
||||
}
|
||||
@ -44,11 +44,11 @@ private readonly IAuthenticator _authenticator;
|
||||
public EnvelopeMailService(IEmailOutRepository repository, IMapper mapper, IEmailTemplateService tempService, IEnvelopeReceiverService envelopeReceiverService, IOptions<DispatcherParams> dispatcherConfigOptions, IConfigService configService, IOptions<MailParams> mailConfig, IAuthenticator authenticator) : base(repository, mapper)
|
||||
{
|
||||
_tempService = tempService;
|
||||
_envRcvService = envelopeReceiverService;
|
||||
_dConfig = dispatcherConfigOptions.Value;
|
||||
_configService = configService;
|
||||
_placeholders = mailConfig.Value.Placeholders;
|
||||
_authenticator = authenticator;
|
||||
_envRcvService = envelopeReceiverService;
|
||||
_dConfig = dispatcherConfigOptions.Value;
|
||||
_configService = configService;
|
||||
_placeholders = new Dictionary<string, string>(mailConfig.Value.Placeholders);
|
||||
_authenticator = authenticator;
|
||||
}
|
||||
|
||||
private async Task<Dictionary<string, string>> CreatePlaceholders(string? accessCode = null, EnvelopeReceiverDto? envelopeReceiverDto = null)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user