protected virtual async Task Update(UserDownloadConfigEditDto input)
        {
            //TODO:更新前的逻辑判断,是否允许更新

            var entity = await _entityManager.FindById(input.Id.Value);

            //input.MapTo(entity);

            ObjectMapper.Map(input, entity);

            var product = await _productManager.GetProductByCode(input.ProductCode);

            entity.ProductCode  = product.Code;
            entity.DownloadType = product.Type;

            // ObjectMapper.Map(input, entity);
            await _entityManager.Update(entity);
        }
        protected virtual async Task <UserDownloadConfigEditDto> Create(UserDownloadConfigEditDto input)
        {
            //TODO:新增前的逻辑判断,是否允许新增

            var entity = ObjectMapper.Map <UserDownloadConfig>(input);
            //var entity = input.MapTo<UserDownloadConfig>();


            var product = await _productManager.GetProductByCode(input.ProductCode);

            entity.ProductCode  = product.Code;
            entity.DownloadType = product.Type;

            await _entityManager.Create(entity);

            return(ObjectMapper.Map <UserDownloadConfigEditDto>(entity));
            //return entity.MapTo<UserDownloadConfigEditDto>();
        }
        public async Task <GetUserDownloadConfigForEditOutput> GetForEdit(NullableIdDto <long> input)
        {
            var output = new GetUserDownloadConfigForEditOutput();
            UserDownloadConfigEditDto editDto;

            if (input.Id.HasValue)
            {
                var entity = await _entityManager.FindById(input.Id.Value);

                editDto = ObjectMapper.Map <UserDownloadConfigEditDto>(entity);
                //editDto = entity.MapTo<UserDownloadConfigEditDto>();

                //userDownloadConfigEditDto = ObjectMapper.Map<List<userDownloadConfigEditDto>>(entity);
            }
            else
            {
                editDto = new UserDownloadConfigEditDto();
            }

            output.UserDownloadConfig = editDto;
            return(output);
        }