ningshuxia
2025-03-13 25d1bf4c50f43cf6690c5ac92824959865c9d78f
Service/HStation.Service.Assets.Core/05-service/03-Valve/05-ValveMainAndPartMapping/AssetsValveMainAndPartMapping_Instance.cs
@@ -3,62 +3,62 @@
    /// <summary>
    /// 阀门型号产品映射
    ///</summary>    
    public partial class AssetsValveMainAndPartMapping
    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;
          }
        //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;
        }
          //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;
          }
        //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 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);
          }
        //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);
        }
    }
}