lixiaojun
2024-12-20 3f24b14f07ef82526b2e1d56cc808f226e91cbb9
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 AssetsTankMainAndPartMapping  
    {
        
          //Entity to GetModel
          internal static Model.AssetsTankMainAndPartMapping Entity2Model(Entity.AssetsTankMainAndPartMapping entity)
          {
              if (entity == null)
                  return default;
              var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Entity.AssetsTankMainAndPartMapping, Model.AssetsTankMainAndPartMapping>()
              ).CreateMapper();
              var model = mapper.Map<Entity.AssetsTankMainAndPartMapping, Model.AssetsTankMainAndPartMapping>(entity);
              return model;
          }
  
          //Entities to GetModels
          internal static List<Model.AssetsTankMainAndPartMapping> Entity2Models(List<Entity.AssetsTankMainAndPartMapping> entities)
          {
              if (entities == null || entities.Count < 1)
                  return default;
              var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Entity.AssetsTankMainAndPartMapping, Model.AssetsTankMainAndPartMapping>()
              ).CreateMapper();
              var models = mapper.Map<List<Entity.AssetsTankMainAndPartMapping>, List<Model.AssetsTankMainAndPartMapping>>(entities);
              return models;
          }
 
          //Model to Entity
          internal static Entity.AssetsTankMainAndPartMapping Model2Entity(Model.AssetsTankMainAndPartMapping model)
          {
              if (model == null)
                  return default;
              var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Model.AssetsTankMainAndPartMapping, Entity.AssetsTankMainAndPartMapping>()
              ).CreateMapper();
              var entity = mapper.Map<Model.AssetsTankMainAndPartMapping, Entity.AssetsTankMainAndPartMapping>(model);
              return entity;
          }
 
          //Models to Entities
          internal static List<Entity.AssetsTankMainAndPartMapping> Model2Entities(List<Model.AssetsTankMainAndPartMapping> models)
          {
              if (models == null || models.Count < 1)
                  return default;
              var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Model.AssetsTankMainAndPartMapping, Entity.AssetsTankMainAndPartMapping>()
              ).CreateMapper();
              var entities = mapper.Map<List<Model.AssetsTankMainAndPartMapping>, List<Entity.AssetsTankMainAndPartMapping>>(models);
              return entities;
          }
 
          //Model to Entity
          internal static void Model2Entity(Model.AssetsTankMainAndPartMapping model, Entity.AssetsTankMainAndPartMapping entity)
          {
              if (model == null || entity == null)
                  return;
              var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Model.AssetsTankMainAndPartMapping, Entity.AssetsTankMainAndPartMapping>()
              ).CreateMapper();
              mapper.Map(model, entity);
          }
 
    }
}