namespace HStation.Service
|
{
|
public partial class AssetsPipeLineCoefficient
|
{
|
//Entity to GetModel
|
internal static Model.AssetsPipeLineCoefficient Entity2Model(Entity.AssetsPipeLineCoefficient entity)
|
{
|
if (entity == null)
|
return default;
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Entity.AssetsPipeLineCoefficient, Model.AssetsPipeLineCoefficient>()
|
).CreateMapper();
|
var model = mapper.Map<Entity.AssetsPipeLineCoefficient, Model.AssetsPipeLineCoefficient>(entity);
|
return model;
|
}
|
|
//Entities to GetModels
|
internal static List<Model.AssetsPipeLineCoefficient> Entity2Models(List<Entity.AssetsPipeLineCoefficient> entities)
|
{
|
if (entities == null || entities.Count < 1)
|
return default;
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Entity.AssetsPipeLineCoefficient, Model.AssetsPipeLineCoefficient>()
|
).CreateMapper();
|
var models = mapper.Map<List<Entity.AssetsPipeLineCoefficient>, List<Model.AssetsPipeLineCoefficient>>(entities);
|
return models;
|
}
|
|
//Model to Entity
|
internal static Entity.AssetsPipeLineCoefficient Model2Entity(Model.AssetsPipeLineCoefficient model)
|
{
|
if (model == null)
|
return default;
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Model.AssetsPipeLineCoefficient, Entity.AssetsPipeLineCoefficient>()
|
).CreateMapper();
|
var entity = mapper.Map<Model.AssetsPipeLineCoefficient, Entity.AssetsPipeLineCoefficient>(model);
|
return entity;
|
}
|
|
//Models to Entities
|
internal static List<Entity.AssetsPipeLineCoefficient> Model2Entities(List<Model.AssetsPipeLineCoefficient> models)
|
{
|
if (models == null || models.Count < 1)
|
return default;
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Model.AssetsPipeLineCoefficient, Entity.AssetsPipeLineCoefficient>()
|
).CreateMapper();
|
var entities = mapper.Map<List<Model.AssetsPipeLineCoefficient>, List<Entity.AssetsPipeLineCoefficient>>(models);
|
return entities;
|
}
|
|
//Model to Entity
|
internal static void Model2Entity(Model.AssetsPipeLineCoefficient model, Entity.AssetsPipeLineCoefficient entity)
|
{
|
if (model == null || entity == null)
|
return;
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Model.AssetsPipeLineCoefficient, Entity.AssetsPipeLineCoefficient>()
|
).CreateMapper();
|
mapper.Map(model, entity);
|
}
|
}
|
}
|