| | |
| | | |
| | | namespace HStation.BLL |
| | | { |
| | | public partial class FourLinkMain |
| | | public partial class AssetsFourlinkMain |
| | | { |
| | | //dto to vmo |
| | | internal static HStation.Vmo.FourLinkMainVmo Dto2Vmo(FourLinkMainDto dto) |
| | | internal static HStation.Vmo.AssetsFourlinkMainVmo Dto2Vmo(AssetsFourlinkMainDto dto) |
| | | { |
| | | if (dto == null) |
| | | { |
| | | return default; |
| | | } |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Dto.Assets.FourLinkMainDto, HStation.Vmo.FourLinkMainVmo>() |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Dto.Assets.AssetsFourlinkMainDto, HStation.Vmo.AssetsFourlinkMainVmo>() |
| | | ).CreateMapper(); |
| | | var vmo = mapper.Map<FourLinkMainDto, HStation.Vmo.FourLinkMainVmo>(dto); |
| | | var vmo = mapper.Map<AssetsFourlinkMainDto, HStation.Vmo.AssetsFourlinkMainVmo>(dto); |
| | | return vmo; |
| | | } |
| | | |
| | | //dto to vmos |
| | | internal static List<HStation.Vmo.FourLinkMainVmo> Dto2Vmos(List<FourLinkMainDto> dtos) |
| | | internal static List<HStation.Vmo.AssetsFourlinkMainVmo> Dto2Vmos(List<AssetsFourlinkMainDto> dtos) |
| | | { |
| | | if (dtos == null || dtos.Count < 1) |
| | | { |
| | | return default; |
| | | } |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<FourLinkMainDto, HStation.Vmo.FourLinkMainVmo>() |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<AssetsFourlinkMainDto, HStation.Vmo.AssetsFourlinkMainVmo>() |
| | | ).CreateMapper(); |
| | | var vmos = mapper.Map<List<FourLinkMainDto>, List<HStation.Vmo.FourLinkMainVmo>>(dtos); |
| | | var vmos = mapper.Map<List<AssetsFourlinkMainDto>, List<HStation.Vmo.AssetsFourlinkMainVmo>>(dtos); |
| | | return vmos; |
| | | } |
| | | |
| | | //vmo to add dto |
| | | internal static HStation.Dto.Assets.AddFourLinkMainInput Vmo2AddDto(HStation.Vmo.FourLinkMainVmo vmo) |
| | | internal static HStation.Dto.Assets.AddAssetsFourlinkMainInput Vmo2AddDto(HStation.Vmo.AssetsFourlinkMainVmo vmo) |
| | | { |
| | | if (vmo == null) |
| | | { |
| | | return default; |
| | | } |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.FourLinkMainVmo, HStation.Dto.Assets.AddFourLinkMainInput>() |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.AssetsFourlinkMainVmo, HStation.Dto.Assets.AddAssetsFourlinkMainInput>() |
| | | ).CreateMapper(); |
| | | var dto = mapper.Map<HStation.Vmo.FourLinkMainVmo, HStation.Dto.Assets.AddFourLinkMainInput>(vmo); |
| | | var dto = mapper.Map<HStation.Vmo.AssetsFourlinkMainVmo, HStation.Dto.Assets.AddAssetsFourlinkMainInput>(vmo); |
| | | return dto; |
| | | } |
| | | |
| | | //vmo to add dtos |
| | | internal static List<HStation.Dto.Assets.AddFourLinkMainInput> Vmo2AddDtos(List<HStation.Vmo.FourLinkMainVmo> vmoList) |
| | | internal static List<HStation.Dto.Assets.AddAssetsFourlinkMainInput> Vmo2AddDtos(List<HStation.Vmo.AssetsFourlinkMainVmo> vmoList) |
| | | { |
| | | if (vmoList == null || vmoList.Count < 1) |
| | | { |
| | | return default; |
| | | } |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.FourLinkMainVmo, HStation.Dto.Assets.AddFourLinkMainInput>() |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.AssetsFourlinkMainVmo, HStation.Dto.Assets.AddAssetsFourlinkMainInput>() |
| | | ).CreateMapper(); |
| | | var dtoList = mapper.Map<List<HStation.Vmo.FourLinkMainVmo>, List<HStation.Dto.Assets.AddFourLinkMainInput>>(vmoList); |
| | | var dtoList = mapper.Map<List<HStation.Vmo.AssetsFourlinkMainVmo>, List<HStation.Dto.Assets.AddAssetsFourlinkMainInput>>(vmoList); |
| | | return dtoList; |
| | | } |
| | | |
| | | //vmo to update dto |
| | | internal static HStation.Dto.Assets.UpdateFourLinkMainInput Vmo2UpdateDto(HStation.Vmo.FourLinkMainVmo vmo) |
| | | internal static HStation.Dto.Assets.UpdateAssetsFourlinkMainInput Vmo2UpdateDto(HStation.Vmo.AssetsFourlinkMainVmo vmo) |
| | | { |
| | | if (vmo == null) |
| | | { |
| | | return default; |
| | | } |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.FourLinkMainVmo, HStation.Dto.Assets.UpdateFourLinkMainInput>() |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.AssetsFourlinkMainVmo, HStation.Dto.Assets.UpdateAssetsFourlinkMainInput>() |
| | | ).CreateMapper(); |
| | | var dto = mapper.Map<HStation.Vmo.FourLinkMainVmo, HStation.Dto.Assets.UpdateFourLinkMainInput>(vmo); |
| | | var dto = mapper.Map<HStation.Vmo.AssetsFourlinkMainVmo, HStation.Dto.Assets.UpdateAssetsFourlinkMainInput>(vmo); |
| | | return dto; |
| | | } |
| | | |
| | | //vmo to update dtos |
| | | internal static List<HStation.Dto.Assets.UpdateFourLinkMainInput> Vmo2UpdateDtos(List<HStation.Vmo.FourLinkMainVmo> vmoList) |
| | | internal static List<HStation.Dto.Assets.UpdateAssetsFourlinkMainInput> Vmo2UpdateDtos(List<HStation.Vmo.AssetsFourlinkMainVmo> vmoList) |
| | | { |
| | | if (vmoList == null || vmoList.Count < 1) |
| | | { |
| | | return default; |
| | | } |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.FourLinkMainVmo, HStation.Dto.Assets.UpdateFourLinkMainInput>() |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.AssetsFourlinkMainVmo, HStation.Dto.Assets.UpdateAssetsFourlinkMainInput>() |
| | | ).CreateMapper(); |
| | | var dtoList = mapper.Map<List<HStation.Vmo.FourLinkMainVmo>, List<HStation.Dto.Assets.UpdateFourLinkMainInput>>(vmoList); |
| | | var dtoList = mapper.Map<List<HStation.Vmo.AssetsFourlinkMainVmo>, List<HStation.Dto.Assets.UpdateAssetsFourlinkMainInput>>(vmoList); |
| | | return dtoList; |
| | | } |
| | | } |