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