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>();
            CreateMap<CheckListTemplateRowDTO, CheckListTemplateRow>();
        }
    }
}
