lixiaojun
2025-01-13 d3b9584def909331007af20b4cdd0bba55919e47
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
namespace Yw.BLL
{
    public partial class SysUnitValue
    {
        //dto to vmo
        internal static Yw.Vmo.SysUnitValueVmo Dto2Vmo(Yw.Dto.SysUnitValueDto dto)
        {
            if (dto == null)
            {
                return default;
            }
            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Yw.Dto.SysUnitValueDto, Yw.Vmo.SysUnitValueVmo>()
            ).CreateMapper();
            var vmo = mapper.Map<Yw.Dto.SysUnitValueDto, Yw.Vmo.SysUnitValueVmo>(dto);
            return vmo;
        }
 
        //dto to vmos
        internal static List<Yw.Vmo.SysUnitValueVmo> Dto2Vmos(List<Yw.Dto.SysUnitValueDto> dtos)
        {
            if (dtos == null || dtos.Count < 1)
            {
                return default;
            }
            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Yw.Dto.SysUnitValueDto, Yw.Vmo.SysUnitValueVmo>()
            ).CreateMapper();
            var vmos = mapper.Map<List<Yw.Dto.SysUnitValueDto>, List<Yw.Vmo.SysUnitValueVmo>>(dtos);
            return vmos;
        }
 
        //vmo to add dto
        internal static Yw.Dto.AddSysUnitValueInput Vmo2AddDto(Yw.Vmo.SysUnitValueVmo vmo)
        {
            if (vmo == null)
            {
                return default;
            }
            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Yw.Vmo.SysUnitValueVmo, Yw.Dto.AddSysUnitValueInput>()
            ).CreateMapper();
            var dto = mapper.Map<Yw.Vmo.SysUnitValueVmo, Yw.Dto.AddSysUnitValueInput>(vmo);
            return dto;
        }
 
        //vmo to add dtos
        internal static List<Yw.Dto.AddSysUnitValueInput> Vmo2AddDtos(List<Yw.Vmo.SysUnitValueVmo> vmoList)
        {
            if (vmoList == null || vmoList.Count < 1)
            {
                return default;
            }
            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Yw.Vmo.SysUnitValueVmo, Yw.Dto.AddSysUnitValueInput>()
            ).CreateMapper();
            var dtoList = mapper.Map<List<Yw.Vmo.SysUnitValueVmo>, List<Yw.Dto.AddSysUnitValueInput>>(vmoList);
            return dtoList;
        }
 
        //vmo to update dto
        internal static Yw.Dto.UpdateSysUnitValueInput Vmo2UpdateDto(Yw.Vmo.SysUnitValueVmo vmo)
        {
            if (vmo == null)
            {
                return default;
            }
            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Yw.Vmo.SysUnitValueVmo, Yw.Dto.UpdateSysUnitValueInput>()
            ).CreateMapper();
            var dto = mapper.Map<Yw.Vmo.SysUnitValueVmo, Yw.Dto.UpdateSysUnitValueInput>(vmo);
            return dto;
        }
 
        //vmo to update dtos
        internal static List<Yw.Dto.UpdateSysUnitValueInput> Vmo2UpdateDtos(List<Yw.Vmo.SysUnitValueVmo> vmoList)
        {
            if (vmoList == null || vmoList.Count < 1)
            {
                return default;
            }
            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Yw.Vmo.SysUnitValueVmo, Yw.Dto.UpdateSysUnitValueInput>()
            ).CreateMapper();
            var dtoList = mapper.Map<List<Yw.Vmo.SysUnitValueVmo>, List<Yw.Dto.UpdateSysUnitValueInput>>(vmoList);
            return dtoList;
        }
 
    }
}