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