Files
EnvelopeGenerator/EnvelopeGenerator.Application/EmailTemplates/MappingProfile.cs
TekH b227eb4051 Refactor UpdateEmailTemplateCommand and handler
- Introduce EmailTemplateUpdateDto for update payloads.
- Expose Id and Type directly on UpdateEmailTemplateCommand; remove EmailTemplateQuery property.
- Add QueryExpression for flexible template selection by Id or Type.
- Remove AutoMapper and EmailTemplateDto usage from handler; update repository call to use EmailTemplateUpdateDto.
- Update MappingProfile to map EmailTemplateUpdateDto to EmailTemplate and set ChangedWhen to DateTime.UtcNow.
- Remove obsolete code and improve documentation.
2026-02-09 11:20:34 +01:00

23 lines
591 B
C#

using AutoMapper;
using EnvelopeGenerator.Application.Common.Dto;
using EnvelopeGenerator.Application.EmailTemplates.Commands;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.EmailTemplates;
/// <summary>
///
/// </summary>
public class MappingProfile : Profile
{
/// <summary>
///
/// </summary>
public MappingProfile()
{
CreateMap<EmailTemplate, EmailTemplateDto>();
CreateMap<EmailTemplateUpdateDto, EmailTemplate>()
.ForMember(dest => dest.ChangedWhen, opt => opt.MapFrom(_ => DateTime.UtcNow));
}
}