Introduced AutoMapperAuditingExtensions with MapAddedWhen and MapChangedWhen methods to standardize mapping of auditing timestamps. Refactored MappingProfile to use these extensions for AddedWhen and ChangedWhen fields, improving code clarity. Updated DocumentStatus to implement auditing interfaces and added necessary imports.
28 lines
812 B
C#
28 lines
812 B
C#
using AutoMapper;
|
|
using EnvelopeGenerator.Application.Common.Extensions;
|
|
using EnvelopeGenerator.Application.DocStatus.Commands;
|
|
using EnvelopeGenerator.Domain.Entities;
|
|
|
|
namespace EnvelopeGenerator.Application.DocStatus;
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public class MappingProfile : Profile
|
|
{
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public MappingProfile()
|
|
{
|
|
CreateMap<CreateDocStatusCommand, DocumentStatus>()
|
|
.ForMember(dest => dest.Envelope, opt => opt.Ignore())
|
|
.ForMember(dest => dest.Receiver, opt => opt.Ignore())
|
|
.MapAddedWhen();
|
|
|
|
CreateMap<UpdateDocStatusCommand, DocumentStatus>()
|
|
.ForMember(dest => dest.Envelope, opt => opt.Ignore())
|
|
.ForMember(dest => dest.Receiver, opt => opt.Ignore())
|
|
.MapChangedWhen();
|
|
}
|
|
} |