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