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