Enhance AutoMapper mappings and add base64 decoding
Updated `MappingProfile` to map `Signature.DataUrl` to `DocReceiverElement.Ink` using the new `MapDataUrlToRequiredBytes` extension method. Added `MapDataUrlToRequiredBytes` to handle base64-encoded data URLs, converting them to byte arrays. Introduced a `using System;` directive in `AutoMapperAuditingExtensions.cs` to support `DateTime`. Retained `MapChangedWhen` functionality while extending mapping capabilities for handling base64 data URLs.
This commit is contained in:
@@ -40,7 +40,9 @@ public class MappingProfile : Profile
|
||||
// DTO to Entity mappings
|
||||
CreateMap<ConfigDto, Config>();
|
||||
CreateMap<DocReceiverElementDto, DocReceiverElement>();
|
||||
CreateMap<Signature, DocReceiverElement>().MapChangedWhen();
|
||||
CreateMap<Signature, DocReceiverElement>()
|
||||
.ForMember(dest => dest.Ink, opt => opt.MapFrom(src => src.DataUrl.MapDataUrlToRequiredBytes()))
|
||||
.MapChangedWhen();
|
||||
CreateMap<DocumentStatusDto, DocumentStatus>();
|
||||
CreateMap<EmailTemplateDto, EmailTemplate>();
|
||||
CreateMap<EnvelopeDto, Envelope>();
|
||||
|
||||
Reference in New Issue
Block a user