From 6291712291ff4ea33f1a3cd089cbba8f8b4bd00d Mon Sep 17 00:00:00 2001 From: TekH Date: Mon, 9 Feb 2026 10:09:21 +0100 Subject: [PATCH] Add AutoMapper profile for EmailTemplate mappings Introduced MappingProfile in EmailTemplates namespace. Maps EmailTemplate to EmailTemplateDto and UpdateEmailTemplateCommand to EmailTemplate, ignoring Id and setting ChangedWhen to current time. --- .../EmailTemplates/MappingProfile.cs | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 EnvelopeGenerator.Application/EmailTemplates/MappingProfile.cs diff --git a/EnvelopeGenerator.Application/EmailTemplates/MappingProfile.cs b/EnvelopeGenerator.Application/EmailTemplates/MappingProfile.cs new file mode 100644 index 00000000..e6cba17d --- /dev/null +++ b/EnvelopeGenerator.Application/EmailTemplates/MappingProfile.cs @@ -0,0 +1,24 @@ +using AutoMapper; +using EnvelopeGenerator.Application.Common.Dto; +using EnvelopeGenerator.Application.EmailTemplates.Commands; +using EnvelopeGenerator.Domain.Entities; + +namespace EnvelopeGenerator.Application.EmailTemplates; + +/// +/// +/// +public class MappingProfile : Profile +{ + /// + /// + /// + public MappingProfile() + { + CreateMap(); + + CreateMap() + .ForMember(dest => dest.Id, opt => opt.Ignore()) + .ForMember(dest => dest.ChangedWhen, opt => opt.MapFrom(_ => DateTime.Now)); + } +} \ No newline at end of file