Files
WorkFlowCheck/src/WorkFlowCheck.MAUI/Mapper/MapperProfile.cs
T

44 lines
2.1 KiB
C#

using AutoMapper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WorkFlowCheck.Common.DTO;
using WorkFlowCheck.MAUI.DataLayer.Entities;
namespace WorkFlowCheck.MAUI.Mapper
{
public class MapperProfile:Profile
{
public MapperProfile()
{
CreateMap<CheckPoint, CheckPointDTO>().ForMember(dest => dest.CheckListTemplateRowDTO, opt => opt.MapFrom(src => src.CheckListTemplateRows));
CreateMap<CheckPointDTO, CheckPoint>();
CreateMap<CheckListTemplateHeaderDTO, CheckListTemplateHeader>()
.ForMember(dest => dest.CheckListTemplateRows, opt => opt.MapFrom(src => src.CheckListTemplateRowDTO));
CreateMap<CheckListTemplateHeader, CheckListTemplateHeaderDTO>()
.ForMember(dest => dest.CheckListTemplateRowDTO, opt => opt.MapFrom(src => src.CheckListTemplateRows));
CreateMap<CheckListTemplateRow, CheckListTemplateRowDTO>()
.ForMember(dest => dest.CheckPointDTO, opt => opt.MapFrom(src => src.CheckPoint));
CreateMap<CheckListTemplateRowDTO, CheckListTemplateRow>();
CreateMap<CheckListHeader, CheckListHeaderDTO>()
.ForMember(dest => dest.CheckListTemplateHeaderDTO, opt => opt.MapFrom(src => src.CheckListTemplateHeader))
.ForMember(dest => dest.CheckListRowDTO, opt => opt.MapFrom(src => src.CheckListRows));
CreateMap<CheckListHeaderDTO, CheckListHeader>()
.ForMember(dest => dest.CheckListRows, opt => opt.MapFrom(src => src.CheckListRowDTO));
CreateMap<CheckListRow, CheckListRowDTO>()
.ForMember(dest => dest.CheckListTemplateRowDTO, opt => opt.MapFrom(src => src.CheckListTemplateRow));
CreateMap<CheckListRowDTO, CheckListRow>()
.ForMember(dest => dest.CheckListTemplateRow, opt => opt.MapFrom(src => src.CheckListTemplateRowDTO));
CreateMap<MobileUser, MobileUserDTO>();
CreateMap<MobileUserDTO, MobileUser>();
}
}
}