/// <summary>
        /// 新增
        /// </summary>
        /// <param name="goodsRequestDto"></param>
        /// <returns></returns>
        public async Task <bool> CreateAsync(GoodsRequestDto goodsRequestDto)
        {
            var goods = _mapper.Map <GoodsRequestDto, Goods>(goodsRequestDto);
            await GoodsValidatorsFilter.DoValidationAsync(_goodsRespository, goods, ValidatorTypeConstants.Create);

            return(await _goodsRespository.InsertAsync(goods));
        }
        /// <summary>
        /// 批量新增
        /// </summary>
        /// <param name="goodsRequestDtos"></param>
        /// <returns></returns>
        public async Task <bool> BatchCreateAsync(IList <GoodsRequestDto> goodsRequestDtos)
        {
            var entities = goodsRequestDtos.MapToList <GoodsRequestDto, Goods>();
            await GoodsValidatorsFilter.DoValidationAsync(_goodsRespository, entities, ValidatorTypeConstants.Create);

            await _goodsRespository.BatchInsertAsync(entities);

            return(true);
        }
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="goodsRequestDto"></param>
        /// <returns></returns>
        public async Task <bool> ModifyAsync(GoodsRequestDto goodsRequestDto)
        {
            var goods = await _goodsRespository.FirstOrDefaultAsync(e => e.Id == goodsRequestDto.Id);

            var entity = goodsRequestDto.MapToModifyEntity <GoodsRequestDto, Goods>(goods);
            await GoodsValidatorsFilter.DoValidationAsync(_goodsRespository, entity, ValidatorTypeConstants.Modify);

            return(await _goodsRespository.UpdateAsync(entity));
        }