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