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.
This commit is contained in:
2026-08-05 14:34:20 +02:00
parent 42b30d4ac4
commit 28f7a3607a

View File

@@ -13,6 +13,7 @@ public class EmailMappingProfile : Profile
{
// SendEmailCommand -> Email
// Sender is resolved via MediatR in the handler and set separately after mapping.
CreateMap<SendEmailCommand, EmailContext>();
CreateMap<SendEmailCommand, EmailContext>()
.ForMember(dest => dest.Sender, opt => opt.Ignore());
}
}