Exemple #1
0
        /// <summary>
        /// 批量新增
        /// </summary>
        /// <param name="orderInfoRequestDtos"></param>
        /// <returns></returns>
        public async Task <JsonResponse> BatchCreateAsync(IList <OrderInfoRequestDto> orderInfoRequestDtos)
        {
            var resJson = await TryTransactionAsync(async() =>
            {
                var entities = orderInfoRequestDtos.MapToList <OrderInfoRequestDto, OrderInfo>();
                await DoValidationAsync(entities, ValidatorTypeConstants.Create);
                await _orderRespository.BatchInsertAsync(entities);
            });

            return(resJson);
        }