Skip to content

Commit

Permalink
Fix object mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
gdlcf88 committed Aug 21, 2023
1 parent 67ef243 commit 9bac545
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions sample/MyProject/aspnet-core/src/MyProject.Web/Program.cs
Expand Up @@ -19,6 +19,7 @@ public static int Main(string[] args)
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.Enrich.FromLogContext()
.WriteTo.Async(c => c.File("Logs/logs.txt"))
.WriteTo.Console()
.CreateLogger();

try
Expand Down
Expand Up @@ -20,7 +20,7 @@ public GiftCardManagementWebAutoMapperProfile()
CreateMap<GiftCardTemplateDto, CreateUpdateGiftCardTemplateViewModel>().ForMember(
model => model.ExtraProperties,
opt => opt.MapFrom(src => JsonConvert.SerializeObject(src.ExtraProperties)));
CreateMap<CreateUpdateGiftCardTemplateViewModel, CreateUpdateGiftCardTemplateDto>(MemberList.Source)
CreateMap<CreateUpdateGiftCardTemplateViewModel, CreateUpdateGiftCardTemplateDto>()
.ForMember(dto => dto.ExtraProperties,
opt => opt.MapFrom(src =>
JsonConvert.DeserializeObject<ExtraPropertyDictionary>(src.ExtraProperties)));
Expand Down

0 comments on commit 9bac545

Please sign in to comment.