lixiaojun
2024-12-18 046e8574ce28d1b8858f8d3619df5a28a2f51e38
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
namespace HStation.Service
{
    /// <summary>
    /// 阀门型号产品映射
    ///</summary>    
    public partial class AssetsValveMainAndPartMapping  
    {
        
          //Entity to GetModel
          internal static Model.AssetsValveMainAndPartMapping Entity2Model(Entity.AssetsValveMainAndPartMapping entity)
          {
              if (entity == null)
                  return default;
              var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Entity.AssetsValveMainAndPartMapping, Model.AssetsValveMainAndPartMapping>()
              ).CreateMapper();
              var model = mapper.Map<Entity.AssetsValveMainAndPartMapping, Model.AssetsValveMainAndPartMapping>(entity);
              return model;
          }
  
          //Entities to GetModels
          internal static List<Model.AssetsValveMainAndPartMapping> Entity2Models(List<Entity.AssetsValveMainAndPartMapping> entities)
          {
              if (entities == null || entities.Count < 1)
                  return default;
              var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Entity.AssetsValveMainAndPartMapping, Model.AssetsValveMainAndPartMapping>()
              ).CreateMapper();
              var models = mapper.Map<List<Entity.AssetsValveMainAndPartMapping>, List<Model.AssetsValveMainAndPartMapping>>(entities);
              return models;
          }
 
          //Model to Entity
          internal static Entity.AssetsValveMainAndPartMapping Model2Entity(Model.AssetsValveMainAndPartMapping model)
          {
              if (model == null)
                  return default;
              var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Model.AssetsValveMainAndPartMapping, Entity.AssetsValveMainAndPartMapping>()
              ).CreateMapper();
              var entity = mapper.Map<Model.AssetsValveMainAndPartMapping, Entity.AssetsValveMainAndPartMapping>(model);
              return entity;
          }
 
          //Models to Entities
          internal static List<Entity.AssetsValveMainAndPartMapping> Model2Entities(List<Model.AssetsValveMainAndPartMapping> models)
          {
              if (models == null || models.Count < 1)
                  return default;
              var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Model.AssetsValveMainAndPartMapping, Entity.AssetsValveMainAndPartMapping>()
              ).CreateMapper();
              var entities = mapper.Map<List<Model.AssetsValveMainAndPartMapping>, List<Entity.AssetsValveMainAndPartMapping>>(models);
              return entities;
          }
 
          //Model to Entity
          internal static void Model2Entity(Model.AssetsValveMainAndPartMapping model, Entity.AssetsValveMainAndPartMapping entity)
          {
              if (model == null || entity == null)
                  return;
              var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Model.AssetsValveMainAndPartMapping, Entity.AssetsValveMainAndPartMapping>()
              ).CreateMapper();
              mapper.Map(model, entity);
          }
 
    }
}