duheng
2024-12-24 63834af1872ab37f22a5e67b5df20a082f7a052a
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
87
using AutoMapper;
using HStation.Dto;
 
namespace HStation.BLL
{
    public partial class AssetsFourlinkFactor
 
    {
        //dto to vmo
        internal static HStation.Vmo.AssetsFourlinkFactorVmo Dto2Vmo(AssetsFourlinkFactorDto dto)
        {
            if (dto == null)
            {
                return default;
            }
            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Dto.AssetsFourlinkFactorDto, HStation.Vmo.AssetsFourlinkFactorVmo>()
            ).CreateMapper();
            var vmo = mapper.Map<AssetsFourlinkFactorDto, HStation.Vmo.AssetsFourlinkFactorVmo>(dto);
            return vmo;
        }
 
        //dto to vmos
        internal static List<HStation.Vmo.AssetsFourlinkFactorVmo> Dto2Vmos(List<AssetsFourlinkFactorDto> dtos)
        {
            if (dtos == null || dtos.Count < 1)
            {
                return default;
            }
            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<AssetsFourlinkFactorDto, HStation.Vmo.AssetsFourlinkFactorVmo>()
            ).CreateMapper();
            var vmos = mapper.Map<List<AssetsFourlinkFactorDto>, List<HStation.Vmo.AssetsFourlinkFactorVmo>>(dtos);
            return vmos;
        }
 
        //vmo to add dto
        internal static HStation.Dto.AddAssetsFourlinkFactorInput Vmo2AddDto(HStation.Vmo.AssetsFourlinkFactorVmo vmo)
        {
            if (vmo == null)
            {
                return default;
            }
            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.AssetsFourlinkFactorVmo, HStation.Dto.AddAssetsFourlinkFactorInput>()
            ).CreateMapper();
            var dto = mapper.Map<HStation.Vmo.AssetsFourlinkFactorVmo, HStation.Dto.AddAssetsFourlinkFactorInput>(vmo);
            return dto;
        }
 
        //vmo to add dtos
        internal static List<HStation.Dto.AddAssetsFourlinkFactorInput> Vmo2AddDtos(List<HStation.Vmo.AssetsFourlinkFactorVmo> vmoList)
        {
            if (vmoList == null || vmoList.Count < 1)
            {
                return default;
            }
            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.AssetsFourlinkFactorVmo, HStation.Dto.AddAssetsFourlinkFactorInput>()
            ).CreateMapper();
            var dtoList = mapper.Map<List<HStation.Vmo.AssetsFourlinkFactorVmo>, List<HStation.Dto.AddAssetsFourlinkFactorInput>>(vmoList);
            return dtoList;
        }
 
        //vmo to update dto
        internal static HStation.Dto.UpdateAssetsFourlinkFactorInput Vmo2UpdateDto(HStation.Vmo.AssetsFourlinkFactorVmo vmo)
        {
            if (vmo == null)
            {
                return default;
            }
            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.AssetsFourlinkFactorVmo, HStation.Dto.UpdateAssetsFourlinkFactorInput>()
            ).CreateMapper();
            var dto = mapper.Map<HStation.Vmo.AssetsFourlinkFactorVmo, HStation.Dto.UpdateAssetsFourlinkFactorInput>(vmo);
            return dto;
        }
 
        //vmo to update dtos
        internal static List<HStation.Dto.UpdateAssetsFourlinkFactorInput> Vmo2UpdateDtos(List<HStation.Vmo.AssetsFourlinkFactorVmo> vmoList)
        {
            if (vmoList == null || vmoList.Count < 1)
            {
                return default;
            }
            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.AssetsFourlinkFactorVmo, HStation.Dto.UpdateAssetsFourlinkFactorInput>()
            ).CreateMapper();
            var dtoList = mapper.Map<List<HStation.Vmo.AssetsFourlinkFactorVmo>, List<HStation.Dto.UpdateAssetsFourlinkFactorInput>>(vmoList);
            return dtoList;
        }
    }
}