namespace HStation.BLL
|
{
|
public partial class XhsProjectSite
|
{
|
//dto to vmo
|
internal static HStation.Vmo.XhsProjectSiteVmo Dto2Vmo(HStation.Dto.XhsProjectSiteDto dto)
|
{
|
if (dto == null)
|
{
|
return default;
|
}
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Dto.XhsProjectSiteDto, HStation.Vmo.XhsProjectSiteVmo>()
|
).CreateMapper();
|
var vmo = mapper.Map<HStation.Dto.XhsProjectSiteDto, HStation.Vmo.XhsProjectSiteVmo>(dto);
|
return vmo;
|
}
|
|
//dto to vmos
|
internal static List<HStation.Vmo.XhsProjectSiteVmo> Dto2Vmos(List<HStation.Dto.XhsProjectSiteDto> dtos)
|
{
|
if (dtos == null || dtos.Count < 1)
|
{
|
return default;
|
}
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Dto.XhsProjectSiteDto, HStation.Vmo.XhsProjectSiteVmo>()
|
).CreateMapper();
|
var vmos = mapper.Map<List<HStation.Dto.XhsProjectSiteDto>, List<HStation.Vmo.XhsProjectSiteVmo>>(dtos);
|
return vmos;
|
}
|
|
//vmo to add dto
|
internal static HStation.Dto.AddXhsProjectSiteInput Vmo2AddDto(HStation.Vmo.XhsProjectSiteVmo vmo)
|
{
|
if (vmo == null)
|
{
|
return default;
|
}
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.XhsProjectSiteVmo, HStation.Dto.AddXhsProjectSiteInput>()
|
).CreateMapper();
|
var dto = mapper.Map<HStation.Vmo.XhsProjectSiteVmo, HStation.Dto.AddXhsProjectSiteInput>(vmo);
|
return dto;
|
}
|
|
//vmo to add dtos
|
internal static List<HStation.Dto.AddXhsProjectSiteInput> Vmo2AddDtos(List<HStation.Vmo.XhsProjectSiteVmo> vmoList)
|
{
|
if (vmoList == null || vmoList.Count < 1)
|
{
|
return default;
|
}
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.XhsProjectSiteVmo, HStation.Dto.AddXhsProjectSiteInput>()
|
).CreateMapper();
|
var dtoList = mapper.Map<List<HStation.Vmo.XhsProjectSiteVmo>, List<HStation.Dto.AddXhsProjectSiteInput>>(vmoList);
|
return dtoList;
|
}
|
|
//vmo to update dto
|
internal static HStation.Dto.UpdateXhsProjectSiteInput Vmo2UpdateDto(HStation.Vmo.XhsProjectSiteVmo vmo)
|
{
|
if (vmo == null)
|
{
|
return default;
|
}
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.XhsProjectSiteVmo, HStation.Dto.UpdateXhsProjectSiteInput>()
|
).CreateMapper();
|
var dto = mapper.Map<HStation.Vmo.XhsProjectSiteVmo, HStation.Dto.UpdateXhsProjectSiteInput>(vmo);
|
return dto;
|
}
|
|
//vmo to update dtos
|
internal static List<HStation.Dto.UpdateXhsProjectSiteInput> Vmo2UpdateDtos(List<HStation.Vmo.XhsProjectSiteVmo> vmoList)
|
{
|
if (vmoList == null || vmoList.Count < 1)
|
{
|
return default;
|
}
|
var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.XhsProjectSiteVmo, HStation.Dto.UpdateXhsProjectSiteInput>()
|
).CreateMapper();
|
var dtoList = mapper.Map<List<HStation.Vmo.XhsProjectSiteVmo>, List<HStation.Dto.UpdateXhsProjectSiteInput>>(vmoList);
|
return dtoList;
|
}
|
|
}
|
}
|