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