| | |
| | | public partial class AssetsKitMain |
| | | { |
| | | //dto to vmo |
| | | internal static HStation.Vmo.AssetsKitMainVmo Dto2Vmo(AssetsKitMainDto dto) |
| | | internal static HStation.Vmo.AssetsPackageMainVmo Dto2Vmo(AssetsPackageMainDto dto) |
| | | { |
| | | if (dto == null) |
| | | { |
| | | return default; |
| | | } |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Dto.Assets.AssetsKitMainDto, HStation.Vmo.AssetsKitMainVmo>() |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Dto.Assets.AssetsPackageMainDto, HStation.Vmo.AssetsPackageMainVmo>() |
| | | ).CreateMapper(); |
| | | var vmo = mapper.Map<AssetsKitMainDto, HStation.Vmo.AssetsKitMainVmo>(dto); |
| | | var vmo = mapper.Map<AssetsPackageMainDto, HStation.Vmo.AssetsPackageMainVmo>(dto); |
| | | return vmo; |
| | | } |
| | | |
| | | //dto to vmos |
| | | internal static List<HStation.Vmo.AssetsKitMainVmo> Dto2Vmos(List<AssetsKitMainDto> dtos) |
| | | internal static List<HStation.Vmo.AssetsPackageMainVmo> Dto2Vmos(List<AssetsPackageMainDto> dtos) |
| | | { |
| | | if (dtos == null || dtos.Count < 1) |
| | | { |
| | | return default; |
| | | } |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<AssetsKitMainDto, HStation.Vmo.AssetsKitMainVmo>() |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<AssetsPackageMainDto, HStation.Vmo.AssetsPackageMainVmo>() |
| | | ).CreateMapper(); |
| | | var vmos = mapper.Map<List<AssetsKitMainDto>, List<HStation.Vmo.AssetsKitMainVmo>>(dtos); |
| | | var vmos = mapper.Map<List<AssetsPackageMainDto>, List<HStation.Vmo.AssetsPackageMainVmo>>(dtos); |
| | | return vmos; |
| | | } |
| | | |
| | | //vmo to add dto |
| | | internal static HStation.Dto.Assets.AddAssetskitMainInput Vmo2AddDto(HStation.Vmo.AssetsKitMainVmo vmo) |
| | | internal static HStation.Dto.Assets.AddAssetsPackageMainInput Vmo2AddDto(HStation.Vmo.AssetsPackageMainVmo vmo) |
| | | { |
| | | if (vmo == null) |
| | | { |
| | | return default; |
| | | } |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.AssetsKitMainVmo, HStation.Dto.Assets.AddAssetskitMainInput>() |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.AssetsPackageMainVmo, HStation.Dto.Assets.AddAssetsPackageMainInput>() |
| | | ).CreateMapper(); |
| | | var dto = mapper.Map<HStation.Vmo.AssetsKitMainVmo, HStation.Dto.Assets.AddAssetskitMainInput>(vmo); |
| | | var dto = mapper.Map<HStation.Vmo.AssetsPackageMainVmo, HStation.Dto.Assets.AddAssetsPackageMainInput>(vmo); |
| | | return dto; |
| | | } |
| | | |
| | | //vmo to add dtos |
| | | internal static List<HStation.Dto.Assets.AddAssetskitMainInput> Vmo2AddDtos(List<HStation.Vmo.AssetsKitMainVmo> vmoList) |
| | | internal static List<HStation.Dto.Assets.AddAssetsPackageMainInput> Vmo2AddDtos(List<HStation.Vmo.AssetsPackageMainVmo> vmoList) |
| | | { |
| | | if (vmoList == null || vmoList.Count < 1) |
| | | { |
| | | return default; |
| | | } |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.AssetsKitMainVmo, HStation.Dto.Assets.AddAssetskitMainInput>() |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.AssetsPackageMainVmo, HStation.Dto.Assets.AddAssetsPackageMainInput>() |
| | | ).CreateMapper(); |
| | | var dtoList = mapper.Map<List<HStation.Vmo.AssetsKitMainVmo>, List<HStation.Dto.Assets.AddAssetskitMainInput>>(vmoList); |
| | | var dtoList = mapper.Map<List<HStation.Vmo.AssetsPackageMainVmo>, List<HStation.Dto.Assets.AddAssetsPackageMainInput>>(vmoList); |
| | | return dtoList; |
| | | } |
| | | |
| | | //vmo to update dto |
| | | internal static HStation.Dto.Assets.UpdateAssetsKitMainInput Vmo2UpdateDto(HStation.Vmo.AssetsKitMainVmo vmo) |
| | | internal static HStation.Dto.Assets.UpdateAssetsPackageMainInput Vmo2UpdateDto(HStation.Vmo.AssetsPackageMainVmo vmo) |
| | | { |
| | | if (vmo == null) |
| | | { |
| | | return default; |
| | | } |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.AssetsKitMainVmo, HStation.Dto.Assets.UpdateAssetsKitMainInput>() |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.AssetsPackageMainVmo, HStation.Dto.Assets.UpdateAssetsPackageMainInput>() |
| | | ).CreateMapper(); |
| | | var dto = mapper.Map<HStation.Vmo.AssetsKitMainVmo, HStation.Dto.Assets.UpdateAssetsKitMainInput>(vmo); |
| | | var dto = mapper.Map<HStation.Vmo.AssetsPackageMainVmo, HStation.Dto.Assets.UpdateAssetsPackageMainInput>(vmo); |
| | | return dto; |
| | | } |
| | | |
| | | //vmo to update dtos |
| | | internal static List<HStation.Dto.Assets.UpdateAssetsKitMainInput> Vmo2UpdateDtos(List<HStation.Vmo.AssetsKitMainVmo> vmoList) |
| | | internal static List<HStation.Dto.Assets.UpdateAssetsPackageMainInput> Vmo2UpdateDtos(List<HStation.Vmo.AssetsPackageMainVmo> vmoList) |
| | | { |
| | | if (vmoList == null || vmoList.Count < 1) |
| | | { |
| | | return default; |
| | | } |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.AssetsKitMainVmo, HStation.Dto.Assets.UpdateAssetsKitMainInput>() |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.AssetsPackageMainVmo, HStation.Dto.Assets.UpdateAssetsPackageMainInput>() |
| | | ).CreateMapper(); |
| | | var dtoList = mapper.Map<List<HStation.Vmo.AssetsKitMainVmo>, List<HStation.Dto.Assets.UpdateAssetsKitMainInput>>(vmoList); |
| | | var dtoList = mapper.Map<List<HStation.Vmo.AssetsPackageMainVmo>, List<HStation.Dto.Assets.UpdateAssetsPackageMainInput>>(vmoList); |
| | | return dtoList; |
| | | } |
| | | } |