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