| | |
| | | |
| | | namespace HStation.BLL |
| | | { |
| | | public partial class PipeSeries |
| | | public partial class AssetsPipeSeries |
| | | { |
| | | //dto to vmo |
| | | internal static HStation.Vmo.PipeSeriesVmo Dto2Vmo(PipeSeriesDto dto) |
| | | internal static HStation.Vmo.AssetsPipeSeriesVmo Dto2Vmo(AssetsPipeSeriesDto dto) |
| | | { |
| | | if (dto == null) |
| | | { |
| | | return default; |
| | | } |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Dto.Assets.PipeSeriesDto, HStation.Vmo.PipeSeriesVmo>() |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Dto.Assets.AssetsPipeSeriesDto, HStation.Vmo.AssetsPipeSeriesVmo>() |
| | | ).CreateMapper(); |
| | | var vmo = mapper.Map<PipeSeriesDto, HStation.Vmo.PipeSeriesVmo>(dto); |
| | | var vmo = mapper.Map<AssetsPipeSeriesDto, HStation.Vmo.AssetsPipeSeriesVmo>(dto); |
| | | return vmo; |
| | | } |
| | | |
| | | //dto to vmos |
| | | internal static List<HStation.Vmo.PipeSeriesVmo> Dto2Vmos(List<PipeSeriesDto> dtos) |
| | | internal static List<HStation.Vmo.AssetsPipeSeriesVmo> Dto2Vmos(List<AssetsPipeSeriesDto> dtos) |
| | | { |
| | | if (dtos == null || dtos.Count < 1) |
| | | { |
| | | return default; |
| | | } |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<PipeSeriesDto, HStation.Vmo.PipeSeriesVmo>() |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<AssetsPipeSeriesDto, HStation.Vmo.AssetsPipeSeriesVmo>() |
| | | ).CreateMapper(); |
| | | var vmos = mapper.Map<List<PipeSeriesDto>, List<HStation.Vmo.PipeSeriesVmo>>(dtos); |
| | | var vmos = mapper.Map<List<AssetsPipeSeriesDto>, List<HStation.Vmo.AssetsPipeSeriesVmo>>(dtos); |
| | | return vmos; |
| | | } |
| | | |
| | | //vmo to add dto |
| | | internal static HStation.Dto.Assets.AddPipeSeriesInput Vmo2AddDto(HStation.Vmo.PipeSeriesVmo vmo) |
| | | internal static HStation.Dto.Assets.AddAssetsPipeSeriesInput Vmo2AddDto(HStation.Vmo.AssetsPipeSeriesVmo vmo) |
| | | { |
| | | if (vmo == null) |
| | | { |
| | | return default; |
| | | } |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.PipeSeriesVmo, HStation.Dto.Assets.AddPipeSeriesInput>() |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.AssetsPipeSeriesVmo, HStation.Dto.Assets.AddAssetsPipeSeriesInput>() |
| | | ).CreateMapper(); |
| | | var dto = mapper.Map<HStation.Vmo.PipeSeriesVmo, HStation.Dto.Assets.AddPipeSeriesInput>(vmo); |
| | | var dto = mapper.Map<HStation.Vmo.AssetsPipeSeriesVmo, HStation.Dto.Assets.AddAssetsPipeSeriesInput>(vmo); |
| | | return dto; |
| | | } |
| | | |
| | | //vmo to add dtos |
| | | internal static List<HStation.Dto.Assets.AddPipeSeriesInput> Vmo2AddDtos(List<HStation.Vmo.PipeSeriesVmo> vmoList) |
| | | internal static List<HStation.Dto.Assets.AddAssetsPipeSeriesInput> Vmo2AddDtos(List<HStation.Vmo.AssetsPipeSeriesVmo> vmoList) |
| | | { |
| | | if (vmoList == null || vmoList.Count < 1) |
| | | { |
| | | return default; |
| | | } |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.PipeSeriesVmo, HStation.Dto.Assets.AddPipeSeriesInput>() |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.AssetsPipeSeriesVmo, HStation.Dto.Assets.AddAssetsPipeSeriesInput>() |
| | | ).CreateMapper(); |
| | | var dtoList = mapper.Map<List<HStation.Vmo.PipeSeriesVmo>, List<HStation.Dto.Assets.AddPipeSeriesInput>>(vmoList); |
| | | var dtoList = mapper.Map<List<HStation.Vmo.AssetsPipeSeriesVmo>, List<HStation.Dto.Assets.AddAssetsPipeSeriesInput>>(vmoList); |
| | | return dtoList; |
| | | } |
| | | |
| | | //vmo to update dto |
| | | internal static HStation.Dto.Assets.UpdatePipeSeriesInput Vmo2UpdateDto(HStation.Vmo.PipeSeriesVmo vmo) |
| | | internal static HStation.Dto.Assets.UpdateAssetsPipeSeriesInput Vmo2UpdateDto(HStation.Vmo.AssetsPipeSeriesVmo vmo) |
| | | { |
| | | if (vmo == null) |
| | | { |
| | | return default; |
| | | } |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.PipeSeriesVmo, HStation.Dto.Assets.UpdatePipeSeriesInput>() |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.AssetsPipeSeriesVmo, HStation.Dto.Assets.UpdateAssetsPipeSeriesInput>() |
| | | ).CreateMapper(); |
| | | var dto = mapper.Map<HStation.Vmo.PipeSeriesVmo, HStation.Dto.Assets.UpdatePipeSeriesInput>(vmo); |
| | | var dto = mapper.Map<HStation.Vmo.AssetsPipeSeriesVmo, HStation.Dto.Assets.UpdateAssetsPipeSeriesInput>(vmo); |
| | | return dto; |
| | | } |
| | | |
| | | //vmo to update dtos |
| | | internal static List<HStation.Dto.Assets.UpdatePipeSeriesInput> Vmo2UpdateDtos(List<HStation.Vmo.PipeSeriesVmo> vmoList) |
| | | internal static List<HStation.Dto.Assets.UpdateAssetsPipeSeriesInput> Vmo2UpdateDtos(List<HStation.Vmo.AssetsPipeSeriesVmo> vmoList) |
| | | { |
| | | if (vmoList == null || vmoList.Count < 1) |
| | | { |
| | | return default; |
| | | } |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.PipeSeriesVmo, HStation.Dto.Assets.UpdatePipeSeriesInput>() |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.AssetsPipeSeriesVmo, HStation.Dto.Assets.UpdateAssetsPipeSeriesInput>() |
| | | ).CreateMapper(); |
| | | var dtoList = mapper.Map<List<HStation.Vmo.PipeSeriesVmo>, List<HStation.Dto.Assets.UpdatePipeSeriesInput>>(vmoList); |
| | | var dtoList = mapper.Map<List<HStation.Vmo.AssetsPipeSeriesVmo>, List<HStation.Dto.Assets.UpdateAssetsPipeSeriesInput>>(vmoList); |
| | | return dtoList; |
| | | } |
| | | } |