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