Shuxia Ning
2024-12-02 ba8e77bcc88fee7d425ebee4aa8676d2b7e683b3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
using AutoMapper;
using HStation.Dto;
 
namespace HStation.BLL
{
    public partial class AssetsExchangerCoefficient
    {
        //dto to vmo
        internal static HStation.Vmo.AssetsExchangerCoefficientVmo Dto2Vmo(AssetsExchangerCoefficientDto dto)
        {
            if (dto == null)
            {
                return default;
            }
            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Dto.Assets.AssetsExchangerCoefficientDto, HStation.Vmo.AssetsExchangerCoefficientVmo>()
            ).CreateMapper();
            var vmo = mapper.Map<AssetsExchangerCoefficientDto, HStation.Vmo.AssetsExchangerCoefficientVmo>(dto);
            return vmo;
        }
 
        //dto to vmos
        internal static List<HStation.Vmo.AssetsExchangerCoefficientVmo> Dto2Vmos(List<AssetsExchangerCoefficientDto> dtos)
        {
            if (dtos == null || dtos.Count < 1)
            {
                return default;
            }
            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<AssetsExchangerCoefficientDto, HStation.Vmo.AssetsExchangerCoefficientVmo>()
            ).CreateMapper();
            var vmos = mapper.Map<List<AssetsExchangerCoefficientDto>, List<HStation.Vmo.AssetsExchangerCoefficientVmo>>(dtos);
            return vmos;
        }
 
        //vmo to add dto
        internal static HStation.Dto.Assets.AddAssetsExchangerCoefficientInput Vmo2AddDto(HStation.Vmo.AssetsExchangerCoefficientVmo vmo)
        {
            if (vmo == null)
            {
                return default;
            }
            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.AssetsExchangerCoefficientVmo, HStation.Dto.Assets.AddAssetsExchangerCoefficientInput>()
            ).CreateMapper();
            var dto = mapper.Map<HStation.Vmo.AssetsExchangerCoefficientVmo, HStation.Dto.Assets.AddAssetsExchangerCoefficientInput>(vmo);
            return dto;
        }
 
        //vmo to add dtos
        internal static List<HStation.Dto.Assets.AddAssetsExchangerCoefficientInput> Vmo2AddDtos(List<HStation.Vmo.AssetsExchangerCoefficientVmo> vmoList)
        {
            if (vmoList == null || vmoList.Count < 1)
            {
                return default;
            }
            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.AssetsExchangerCoefficientVmo, HStation.Dto.Assets.AddAssetsExchangerCoefficientInput>()
            ).CreateMapper();
            var dtoList = mapper.Map<List<HStation.Vmo.AssetsExchangerCoefficientVmo>, List<HStation.Dto.Assets.AddAssetsExchangerCoefficientInput>>(vmoList);
            return dtoList;
        }
 
        //vmo to update dto
        internal static HStation.Dto.Assets.UpdateAssetsExchangerCoefficientInput Vmo2UpdateDto(HStation.Vmo.AssetsExchangerCoefficientVmo vmo)
        {
            if (vmo == null)
            {
                return default;
            }
            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.AssetsExchangerCoefficientVmo, HStation.Dto.Assets.UpdateAssetsExchangerCoefficientInput>()
            ).CreateMapper();
            var dto = mapper.Map<HStation.Vmo.AssetsExchangerCoefficientVmo, HStation.Dto.Assets.UpdateAssetsExchangerCoefficientInput>(vmo);
            return dto;
        }
 
        //vmo to update dtos
        internal static List<HStation.Dto.Assets.UpdateAssetsExchangerCoefficientInput> Vmo2UpdateDtos(List<HStation.Vmo.AssetsExchangerCoefficientVmo> vmoList)
        {
            if (vmoList == null || vmoList.Count < 1)
            {
                return default;
            }
            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.AssetsExchangerCoefficientVmo, HStation.Dto.Assets.UpdateAssetsExchangerCoefficientInput>()
            ).CreateMapper();
            var dtoList = mapper.Map<List<HStation.Vmo.AssetsExchangerCoefficientVmo>, List<HStation.Dto.Assets.UpdateAssetsExchangerCoefficientInput>>(vmoList);
            return dtoList;
        }
    }
}