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