duheng
2024-12-24 63834af1872ab37f22a5e67b5df20a082f7a052a
BLL/HStation.BLL.Assets.Core/04-bll/08-FourLink/03-AssetsFourlinkCoefficient/AssetsFourlinkCoefficient_Instance.cs
@@ -3,83 +3,84 @@
namespace HStation.BLL
{
    public partial class AssetsFourlinkCoefficient
    public partial class AssetsFourlinkFactor
    {
        //dto to vmo
        internal static HStation.Vmo.AssetsFourlinkCoefficientVmo Dto2Vmo(AssetsFourlinkFactorDto dto)
        internal static HStation.Vmo.AssetsFourlinkFactorVmo Dto2Vmo(AssetsFourlinkFactorDto dto)
        {
            if (dto == null)
            {
                return default;
            }
            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Dto.Assets.AssetsFourlinkFactorDto, HStation.Vmo.AssetsFourlinkCoefficientVmo>()
            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Dto.AssetsFourlinkFactorDto, HStation.Vmo.AssetsFourlinkFactorVmo>()
            ).CreateMapper();
            var vmo = mapper.Map<AssetsFourlinkFactorDto, HStation.Vmo.AssetsFourlinkCoefficientVmo>(dto);
            var vmo = mapper.Map<AssetsFourlinkFactorDto, HStation.Vmo.AssetsFourlinkFactorVmo>(dto);
            return vmo;
        }
        //dto to vmos
        internal static List<HStation.Vmo.AssetsFourlinkCoefficientVmo> Dto2Vmos(List<AssetsFourlinkFactorDto> dtos)
        internal static List<HStation.Vmo.AssetsFourlinkFactorVmo> Dto2Vmos(List<AssetsFourlinkFactorDto> dtos)
        {
            if (dtos == null || dtos.Count < 1)
            {
                return default;
            }
            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<AssetsFourlinkFactorDto, HStation.Vmo.AssetsFourlinkCoefficientVmo>()
            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<AssetsFourlinkFactorDto, HStation.Vmo.AssetsFourlinkFactorVmo>()
            ).CreateMapper();
            var vmos = mapper.Map<List<AssetsFourlinkFactorDto>, List<HStation.Vmo.AssetsFourlinkCoefficientVmo>>(dtos);
            var vmos = mapper.Map<List<AssetsFourlinkFactorDto>, List<HStation.Vmo.AssetsFourlinkFactorVmo>>(dtos);
            return vmos;
        }
        //vmo to add dto
        internal static HStation.Dto.Assets.AddAssetsFourlinkFactorInput Vmo2AddDto(HStation.Vmo.AssetsFourlinkCoefficientVmo vmo)
        internal static HStation.Dto.AddAssetsFourlinkFactorInput Vmo2AddDto(HStation.Vmo.AssetsFourlinkFactorVmo vmo)
        {
            if (vmo == null)
            {
                return default;
            }
            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.AssetsFourlinkCoefficientVmo, HStation.Dto.Assets.AddAssetsFourlinkFactorInput>()
            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.AssetsFourlinkFactorVmo, HStation.Dto.AddAssetsFourlinkFactorInput>()
            ).CreateMapper();
            var dto = mapper.Map<HStation.Vmo.AssetsFourlinkCoefficientVmo, HStation.Dto.Assets.AddAssetsFourlinkFactorInput>(vmo);
            var dto = mapper.Map<HStation.Vmo.AssetsFourlinkFactorVmo, HStation.Dto.AddAssetsFourlinkFactorInput>(vmo);
            return dto;
        }
        //vmo to add dtos
        internal static List<HStation.Dto.Assets.AddAssetsFourlinkFactorInput> Vmo2AddDtos(List<HStation.Vmo.AssetsFourlinkCoefficientVmo> vmoList)
        internal static List<HStation.Dto.AddAssetsFourlinkFactorInput> Vmo2AddDtos(List<HStation.Vmo.AssetsFourlinkFactorVmo> vmoList)
        {
            if (vmoList == null || vmoList.Count < 1)
            {
                return default;
            }
            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.AssetsFourlinkCoefficientVmo, HStation.Dto.Assets.AddAssetsFourlinkFactorInput>()
            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.AssetsFourlinkFactorVmo, HStation.Dto.AddAssetsFourlinkFactorInput>()
            ).CreateMapper();
            var dtoList = mapper.Map<List<HStation.Vmo.AssetsFourlinkCoefficientVmo>, List<HStation.Dto.Assets.AddAssetsFourlinkFactorInput>>(vmoList);
            var dtoList = mapper.Map<List<HStation.Vmo.AssetsFourlinkFactorVmo>, List<HStation.Dto.AddAssetsFourlinkFactorInput>>(vmoList);
            return dtoList;
        }
        //vmo to update dto
        internal static HStation.Dto.Assets.UpdateAssetsFourlinkFactorInput Vmo2UpdateDto(HStation.Vmo.AssetsFourlinkCoefficientVmo vmo)
        internal static HStation.Dto.UpdateAssetsFourlinkFactorInput Vmo2UpdateDto(HStation.Vmo.AssetsFourlinkFactorVmo vmo)
        {
            if (vmo == null)
            {
                return default;
            }
            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.AssetsFourlinkCoefficientVmo, HStation.Dto.Assets.UpdateAssetsFourlinkFactorInput>()
            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.AssetsFourlinkFactorVmo, HStation.Dto.UpdateAssetsFourlinkFactorInput>()
            ).CreateMapper();
            var dto = mapper.Map<HStation.Vmo.AssetsFourlinkCoefficientVmo, HStation.Dto.Assets.UpdateAssetsFourlinkFactorInput>(vmo);
            var dto = mapper.Map<HStation.Vmo.AssetsFourlinkFactorVmo, HStation.Dto.UpdateAssetsFourlinkFactorInput>(vmo);
            return dto;
        }
        //vmo to update dtos
        internal static List<HStation.Dto.Assets.UpdateAssetsFourlinkFactorInput> Vmo2UpdateDtos(List<HStation.Vmo.AssetsFourlinkCoefficientVmo> vmoList)
        internal static List<HStation.Dto.UpdateAssetsFourlinkFactorInput> Vmo2UpdateDtos(List<HStation.Vmo.AssetsFourlinkFactorVmo> vmoList)
        {
            if (vmoList == null || vmoList.Count < 1)
            {
                return default;
            }
            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.AssetsFourlinkCoefficientVmo, HStation.Dto.Assets.UpdateAssetsFourlinkFactorInput>()
            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.AssetsFourlinkFactorVmo, HStation.Dto.UpdateAssetsFourlinkFactorInput>()
            ).CreateMapper();
            var dtoList = mapper.Map<List<HStation.Vmo.AssetsFourlinkCoefficientVmo>, List<HStation.Dto.Assets.UpdateAssetsFourlinkFactorInput>>(vmoList);
            var dtoList = mapper.Map<List<HStation.Vmo.AssetsFourlinkFactorVmo>, List<HStation.Dto.UpdateAssetsFourlinkFactorInput>>(vmoList);
            return dtoList;
        }
    }