From 28f7a3607acc98a160827e029ffc437905f6bd25 Mon Sep 17 00:00:00 2001 From: TekH Date: Wed, 5 Aug 2026 14:34:20 +0200 Subject: [PATCH] Update EmailContext mapping to ignore Sender property The `EmailMappingProfile` class was updated to modify the mapping configuration between `SendEmailCommand` and `EmailContext`. A `.ForMember` configuration was added to explicitly ignore the `Sender` property in the destination (`EmailContext`) during the mapping process. This ensures that `Sender` is not mapped from the source object and must be set separately. --- .../Common/Mappings/EmailMappingProfile.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/DigitalData.MessagingService.Application/Common/Mappings/EmailMappingProfile.cs b/src/core/DigitalData.MessagingService.Application/Common/Mappings/EmailMappingProfile.cs index 4726a32..9ada128 100644 --- a/src/core/DigitalData.MessagingService.Application/Common/Mappings/EmailMappingProfile.cs +++ b/src/core/DigitalData.MessagingService.Application/Common/Mappings/EmailMappingProfile.cs @@ -13,6 +13,7 @@ public class EmailMappingProfile : Profile { // SendEmailCommand -> Email // Sender is resolved via MediatR in the handler and set separately after mapping. - CreateMap(); + CreateMap() + .ForMember(dest => dest.Sender, opt => opt.Ignore()); } }