Update RecActionViewDto mapping and add Profile property

Refactored DtoMappingProfile to pass both the source object and its Profile to ReplacePlaceholders when mapping queries. Added a nullable Profile property to RecActionViewDto to include full profile details in the DTO.
This commit is contained in:
2026-03-26 15:48:06 +01:00
parent fa438e70cb
commit ff7d6c99ae
2 changed files with 4 additions and 2 deletions

View File

@@ -9,9 +9,9 @@ public class DtoMappingProfile : AutoMapper.Profile
{
CreateMap<RecActionView, RecActionViewDto>()
.ForMember(dest => dest.PreprocessingQuery, opt => opt.MapFrom((src, _) =>
src.PreprocessingQuery?.ReplacePlaceholders(src)))
src.PreprocessingQuery?.ReplacePlaceholders(src, src.Profile)))
.ForMember(dest => dest.PostprocessingQuery, opt => opt.MapFrom((src, _) =>
src.PostprocessingQuery?.ReplacePlaceholders(src)));
src.PostprocessingQuery?.ReplacePlaceholders(src, src.Profile)));
CreateMap<ResultView, ResultViewDto>();
CreateMap<ProfileView, ProfileViewDto>();

View File

@@ -8,6 +8,8 @@ public record RecActionViewDto
public long? ProfileId { get; init; }
public ProfileViewDto? Profile { get; init; }
public string? ProfileName { get; init; }
public ProfileType? ProfileType { get; init; }