From e828ba48f023cd13c6b5caadfc7c4a71135dcf34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20J=C3=B8rgen=20Skogstad?= Date: Thu, 3 Oct 2024 12:33:27 +0200 Subject: [PATCH] fix mapping --- .../Dialogs/Commands/Update/MappingProfile.cs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Update/MappingProfile.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Update/MappingProfile.cs index 7bbf6aef0..bd3591f2f 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Update/MappingProfile.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Update/MappingProfile.cs @@ -60,7 +60,7 @@ public MappingProfile() CreateMap?>() .ConvertUsing>(); - // Since these are append only, we don't need to merge with existing + // Since these are append-only, we don't need to merge with existing // activity/transmission records and thus can map complex properties CreateMap() .ForMember(dest => dest.Type, opt => opt.Ignore()) @@ -70,6 +70,10 @@ public MappingProfile() .ForMember(dest => dest.ActorType, opt => opt.Ignore()) .ForMember(dest => dest.ActorTypeId, opt => opt.MapFrom(src => src.ActorType)); + CreateMap() + .ForMember(dest => dest.Type, opt => opt.Ignore()) + .ForMember(dest => dest.TypeId, opt => opt.MapFrom(src => src.Type)); + CreateMap?>() .ConvertUsing>(); @@ -77,16 +81,10 @@ public MappingProfile() .ForMember(dest => dest.ActorType, opt => opt.Ignore()) .ForMember(dest => dest.ActorTypeId, opt => opt.MapFrom(src => src.ActorType)); - CreateMap() - .ForMember(dest => dest.Type, opt => opt.Ignore()) - .ForMember(dest => dest.TypeId, opt => opt.MapFrom(src => src.Type)); - CreateMap() - .IgnoreComplexDestinationProperties() .ForMember(x => x.Id, opt => opt.Ignore()); CreateMap() - .IgnoreComplexDestinationProperties() .ForMember(x => x.Id, opt => opt.Ignore()) .ForMember(dest => dest.ConsumerType, opt => opt.Ignore()) .ForMember(dest => dest.ConsumerTypeId, opt => opt.MapFrom(src => src.ConsumerType));