using AutoMapper;
|
using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
|
namespace IStation.Service
|
{
|
public partial class EtaStandardSingleRecord
|
{
|
#region 时记录
|
|
//Entity to GetModel
|
private Model.EtaStandardSingleHourRecord Entity2Model(Entity.EtaStandardSingleHourRecord entity)
|
{
|
if (entity == null)
|
return default;
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Entity.EtaStandardSingleHourRecord, Model.EtaStandardSingleHourRecord>()).CreateMapper();
|
var model = mapper.Map<Entity.EtaStandardSingleHourRecord, Model.EtaStandardSingleHourRecord>(entity);
|
return model;
|
}
|
|
//Entities to GetModels
|
private List<Model.EtaStandardSingleHourRecord> Entity2Models(List<Entity.EtaStandardSingleHourRecord> entities)
|
{
|
if (entities == null || entities.Count() < 1)
|
return default;
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Entity.EtaStandardSingleHourRecord, Model.EtaStandardSingleHourRecord>()).CreateMapper();
|
var models = mapper.Map<List<Entity.EtaStandardSingleHourRecord>, List<Model.EtaStandardSingleHourRecord>>(entities);
|
return models;
|
}
|
|
//Model to Entity
|
private Entity.EtaStandardSingleHourRecord Model2Entity(Model.EtaStandardSingleHourRecord model)
|
{
|
if (model == null)
|
return default;
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Model.EtaStandardSingleHourRecord, Entity.EtaStandardSingleHourRecord>()).CreateMapper();
|
var entity = mapper.Map<Model.EtaStandardSingleHourRecord, Entity.EtaStandardSingleHourRecord>(model);
|
return entity;
|
}
|
|
//Models to Entities
|
private List<Entity.EtaStandardSingleHourRecord> Model2Entities(List<Model.EtaStandardSingleHourRecord> models)
|
{
|
if (models == null || models.Count < 1)
|
return default;
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Model.EtaStandardSingleHourRecord, Entity.EtaStandardSingleHourRecord>()).CreateMapper();
|
var entities = mapper.Map<List<Model.EtaStandardSingleHourRecord>, List<Entity.EtaStandardSingleHourRecord>>(models);
|
return entities;
|
}
|
|
//Model to Entity
|
private void Model2Entity(Model.EtaStandardSingleHourRecord model, Entity.EtaStandardSingleHourRecord entity)
|
{
|
if (model == null || entity == null)
|
return;
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Model.EtaStandardSingleHourRecord, Entity.EtaStandardSingleHourRecord>()).CreateMapper();
|
mapper.Map(model, entity);
|
}
|
|
#endregion
|
|
#region 日记录
|
|
//Entity to GetModel
|
private Model.EtaStandardSingleDayRecord Entity2Model(Entity.EtaStandardSingleDayRecord entity)
|
{
|
if (entity == null)
|
return default;
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Entity.EtaStandardSingleDayRecord, Model.EtaStandardSingleDayRecord>()).CreateMapper();
|
var model = mapper.Map<Entity.EtaStandardSingleDayRecord, Model.EtaStandardSingleDayRecord>(entity);
|
return model;
|
}
|
|
//Entities to GetModels
|
private List<Model.EtaStandardSingleDayRecord> Entity2Models(List<Entity.EtaStandardSingleDayRecord> entities)
|
{
|
if (entities == null || entities.Count() < 1)
|
return default;
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Entity.EtaStandardSingleDayRecord, Model.EtaStandardSingleDayRecord>()).CreateMapper();
|
var models = mapper.Map<List<Entity.EtaStandardSingleDayRecord>, List<Model.EtaStandardSingleDayRecord>>(entities);
|
return models;
|
}
|
|
//Model to Entity
|
private Entity.EtaStandardSingleDayRecord Model2Entity(Model.EtaStandardSingleDayRecord model)
|
{
|
if (model == null)
|
return default;
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Model.EtaStandardSingleDayRecord, Entity.EtaStandardSingleDayRecord>()).CreateMapper();
|
var entity = mapper.Map<Model.EtaStandardSingleDayRecord, Entity.EtaStandardSingleDayRecord>(model);
|
return entity;
|
}
|
|
//Models to Entities
|
private List<Entity.EtaStandardSingleDayRecord> Model2Entities(List<Model.EtaStandardSingleDayRecord> models)
|
{
|
if (models == null || models.Count < 1)
|
return default;
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Model.EtaStandardSingleDayRecord, Entity.EtaStandardSingleDayRecord>()).CreateMapper();
|
var entities = mapper.Map<List<Model.EtaStandardSingleDayRecord>, List<Entity.EtaStandardSingleDayRecord>>(models);
|
return entities;
|
}
|
|
//Model to Entity
|
private void Model2Entity(Model.EtaStandardSingleDayRecord model, Entity.EtaStandardSingleDayRecord entity)
|
{
|
if (model == null || entity == null)
|
return;
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Model.EtaStandardSingleDayRecord, Entity.EtaStandardSingleDayRecord>()).CreateMapper();
|
mapper.Map(model, entity);
|
}
|
|
#endregion
|
|
#region 周记录
|
|
//Entity to GetModel
|
private Model.EtaStandardSingleWeekRecord Entity2Model(Entity.EtaStandardSingleWeekRecord entity)
|
{
|
if (entity == null)
|
return default;
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Entity.EtaStandardSingleWeekRecord, Model.EtaStandardSingleWeekRecord>()).CreateMapper();
|
var model = mapper.Map<Entity.EtaStandardSingleWeekRecord, Model.EtaStandardSingleWeekRecord>(entity);
|
return model;
|
}
|
|
//Entities to GetModels
|
private List<Model.EtaStandardSingleWeekRecord> Entity2Models(List<Entity.EtaStandardSingleWeekRecord> entities)
|
{
|
if (entities == null || entities.Count() < 1)
|
return default;
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Entity.EtaStandardSingleWeekRecord, Model.EtaStandardSingleWeekRecord>()).CreateMapper();
|
var models = mapper.Map<List<Entity.EtaStandardSingleWeekRecord>, List<Model.EtaStandardSingleWeekRecord>>(entities);
|
return models;
|
}
|
|
//Model to Entity
|
private Entity.EtaStandardSingleWeekRecord Model2Entity(Model.EtaStandardSingleWeekRecord model)
|
{
|
if (model == null)
|
return default;
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Model.EtaStandardSingleWeekRecord, Entity.EtaStandardSingleWeekRecord>()).CreateMapper();
|
var entity = mapper.Map<Model.EtaStandardSingleWeekRecord, Entity.EtaStandardSingleWeekRecord>(model);
|
return entity;
|
}
|
|
//Models to Entities
|
private List<Entity.EtaStandardSingleWeekRecord> Model2Entities(List<Model.EtaStandardSingleWeekRecord> models)
|
{
|
if (models == null || models.Count < 1)
|
return default;
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Model.EtaStandardSingleWeekRecord, Entity.EtaStandardSingleWeekRecord>()).CreateMapper();
|
var entities = mapper.Map<List<Model.EtaStandardSingleWeekRecord>, List<Entity.EtaStandardSingleWeekRecord>>(models);
|
return entities;
|
}
|
|
//Model to Entity
|
private void Model2Entity(Model.EtaStandardSingleWeekRecord model, Entity.EtaStandardSingleWeekRecord entity)
|
{
|
if (model == null || entity == null)
|
return;
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Model.EtaStandardSingleWeekRecord, Entity.EtaStandardSingleWeekRecord>()).CreateMapper();
|
mapper.Map(model, entity);
|
}
|
|
#endregion
|
|
#region 月记录
|
|
//Entity to GetModel
|
private Model.EtaStandardSingleMonthRecord Entity2Model(Entity.EtaStandardSingleMonthRecord entity)
|
{
|
if (entity == null)
|
return default;
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Entity.EtaStandardSingleMonthRecord, Model.EtaStandardSingleMonthRecord>()).CreateMapper();
|
var model = mapper.Map<Entity.EtaStandardSingleMonthRecord, Model.EtaStandardSingleMonthRecord>(entity);
|
return model;
|
}
|
|
//Entities to GetModels
|
private List<Model.EtaStandardSingleMonthRecord> Entity2Models(List<Entity.EtaStandardSingleMonthRecord> entities)
|
{
|
if (entities == null || entities.Count() < 1)
|
return default;
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Entity.EtaStandardSingleMonthRecord, Model.EtaStandardSingleMonthRecord>()).CreateMapper();
|
var models = mapper.Map<List<Entity.EtaStandardSingleMonthRecord>, List<Model.EtaStandardSingleMonthRecord>>(entities);
|
return models;
|
}
|
|
//Model to Entity
|
private Entity.EtaStandardSingleMonthRecord Model2Entity(Model.EtaStandardSingleMonthRecord model)
|
{
|
if (model == null)
|
return default;
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Model.EtaStandardSingleMonthRecord, Entity.EtaStandardSingleMonthRecord>()).CreateMapper();
|
var entity = mapper.Map<Model.EtaStandardSingleMonthRecord, Entity.EtaStandardSingleMonthRecord>(model);
|
return entity;
|
}
|
|
//Models to Entities
|
private List<Entity.EtaStandardSingleMonthRecord> Model2Entities(List<Model.EtaStandardSingleMonthRecord> models)
|
{
|
if (models == null || models.Count < 1)
|
return default;
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Model.EtaStandardSingleMonthRecord, Entity.EtaStandardSingleMonthRecord>()).CreateMapper();
|
var entities = mapper.Map<List<Model.EtaStandardSingleMonthRecord>, List<Entity.EtaStandardSingleMonthRecord>>(models);
|
return entities;
|
}
|
|
//Model to Entity
|
private void Model2Entity(Model.EtaStandardSingleMonthRecord model, Entity.EtaStandardSingleMonthRecord entity)
|
{
|
if (model == null || entity == null)
|
return;
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Model.EtaStandardSingleMonthRecord, Entity.EtaStandardSingleMonthRecord>()).CreateMapper();
|
mapper.Map(model, entity);
|
}
|
|
#endregion
|
|
#region 年记录
|
|
//Entity to GetModel
|
private Model.EtaStandardSingleYearRecord Entity2Model(Entity.EtaStandardSingleYearRecord entity)
|
{
|
if (entity == null)
|
return default;
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Entity.EtaStandardSingleYearRecord, Model.EtaStandardSingleYearRecord>()).CreateMapper();
|
var model = mapper.Map<Entity.EtaStandardSingleYearRecord, Model.EtaStandardSingleYearRecord>(entity);
|
return model;
|
}
|
|
//Entities to GetModels
|
private List<Model.EtaStandardSingleYearRecord> Entity2Models(List<Entity.EtaStandardSingleYearRecord> entities)
|
{
|
if (entities == null || entities.Count() < 1)
|
return default;
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Entity.EtaStandardSingleYearRecord, Model.EtaStandardSingleYearRecord>()).CreateMapper();
|
var models = mapper.Map<List<Entity.EtaStandardSingleYearRecord>, List<Model.EtaStandardSingleYearRecord>>(entities);
|
return models;
|
}
|
|
//Model to Entity
|
private Entity.EtaStandardSingleYearRecord Model2Entity(Model.EtaStandardSingleYearRecord model)
|
{
|
if (model == null)
|
return default;
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Model.EtaStandardSingleYearRecord, Entity.EtaStandardSingleYearRecord>()).CreateMapper();
|
var entity = mapper.Map<Model.EtaStandardSingleYearRecord, Entity.EtaStandardSingleYearRecord>(model);
|
return entity;
|
}
|
|
//Models to Entities
|
private List<Entity.EtaStandardSingleYearRecord> Model2Entities(List<Model.EtaStandardSingleYearRecord> models)
|
{
|
if (models == null || models.Count < 1)
|
return default;
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Model.EtaStandardSingleYearRecord, Entity.EtaStandardSingleYearRecord>()).CreateMapper();
|
var entities = mapper.Map<List<Model.EtaStandardSingleYearRecord>, List<Entity.EtaStandardSingleYearRecord>>(models);
|
return entities;
|
}
|
|
//Model to Entity
|
private void Model2Entity(Model.EtaStandardSingleYearRecord model, Entity.EtaStandardSingleYearRecord entity)
|
{
|
if (model == null || entity == null)
|
return;
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Model.EtaStandardSingleYearRecord, Entity.EtaStandardSingleYearRecord>()).CreateMapper();
|
mapper.Map(model, entity);
|
}
|
|
#endregion
|
}
|
}
|