- 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.
23 lines
591 B
C#
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));
|
|
}
|
|
} |