20 lines
641 B
C#
20 lines
641 B
C#
using AutoMapper;
|
|
using DigitalData.EmailProfiler.Application.Common.Events;
|
|
using DigitalData.EmailProfiler.Application.EmailSending.Commands;
|
|
|
|
namespace DigitalData.EmailProfiler.Application.Common.Mappings;
|
|
|
|
/// <summary>
|
|
/// AutoMapper profile for Emails
|
|
/// </summary>
|
|
public class EmailMappingProfile : Profile
|
|
{
|
|
public EmailMappingProfile()
|
|
{
|
|
// SendEmailCommand -> OutgoingEmailEvent
|
|
CreateMap<SendEmailCommand, OutgoingEmailEvent>()
|
|
.ForMember(dest => dest.Id, opt => opt.MapFrom(_ => Guid.NewGuid()))
|
|
.ForMember(dest => dest.QueuedAt, opt => opt.MapFrom(_ => DateTime.Now));
|
|
}
|
|
}
|