コード例 #1
0
        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="orderInfoRequestDto"></param>
        /// <returns></returns>
        public async Task <JsonResponse> CreateAsync(OrderInfoRequestDto orderInfoRequestDto)
        {
            var resJson = await TryTransactionAsync(async() =>
            {
                var orderInfo = _mapper.Map <OrderInfoRequestDto, OrderInfo>(orderInfoRequestDto);
                await DoValidationAsync(orderInfo, ValidatorTypeConstants.Create);
                await _orderRespository.InsertAsync(orderInfo);
            });

            return(resJson);
        }