37 lines
1.5 KiB
C#
37 lines
1.5 KiB
C#
using WorkFlow.Application.Buttons;
|
|
using WorkFlow.Application.Dto;
|
|
using WorkFlow.Domain.Entities;
|
|
|
|
namespace WorkFlow.Application.Mapping;
|
|
|
|
public class MappingProfile : AutoMapper.Profile
|
|
{
|
|
public MappingProfile()
|
|
{
|
|
CreateMap<Config, ConfigDto>();
|
|
|
|
CreateMap<Profile, ProfileDto>();
|
|
|
|
CreateMap<PControlsTF, PControlsTFDto>();
|
|
|
|
CreateMap<Button, ButtonDto>();
|
|
|
|
CreateMap<PObject, ObjectDto>()
|
|
.ForMember(dest => dest.Headlines, opt => opt.MapFrom(src => new[] { src.Headline1, src.Headline2 }))
|
|
.ForMember(dest => dest.Sublines, opt => opt.MapFrom(src => new[] { src.Subline1, src.Subline2 }));
|
|
|
|
CreateMap<PObjectState, ObjectStateDto>()
|
|
.ForMember(dest => dest.Intl, opt => opt.MapFrom(src => src.State1 != null ? src.State1.IntlState : null))
|
|
.ForMember(dest => dest.Others, opt => opt.MapFrom(src => new string?[] { src.State2, src.State3, src.State4 }));
|
|
|
|
CreateMap<PObjectStateHist, ObjectStateHistDto>()
|
|
.ForMember(dest => dest.Intl, opt => opt.MapFrom(src => src.State1 != null ? src.State1.IntlState : null))
|
|
.ForMember(dest => dest.Others, opt => opt.MapFrom(src => new string?[] { src.State2, src.State3, src.State4 }));
|
|
|
|
CreateMap<TfFile, TfFileDto>()
|
|
.ForMember(dest => dest.Url, opt => opt.MapFrom<TfFileUriResolver>())
|
|
.ForMember(dest => dest.IconUrl, opt => opt.MapFrom<TfFileIconUriResolver>());
|
|
|
|
CreateMap<PControlsUpdate, PControlsUpdateDto>();
|
|
}
|
|
} |