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