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