/// <summary>
        ///异步验证
        /// </summary>
        public static async Task DoValidationAsync(IOrderDetailRespository orderDetailRespository, OrderDetail orderDetail, string validatorType)
        {
            var orderDetailValidator = new OrderDetailValidator(orderDetailRespository);
            var validatorReresult    = await orderDetailValidator.DoValidateAsync(orderDetail, validatorType);

            if (!validatorReresult.IsValid)
            {
                throw new DomainException(validatorReresult);
            }
        }
        /// <summary>
        ///异步验证
        /// </summary>
        private async Task DoValidationAsync(OrderDetail OrderDetail, string validatorType)
        {
            var OrderDetailValidator = new OrderDetailValidator();
            var validatorReresult    = await OrderDetailValidator.DoValidateAsync(OrderDetail, validatorType);

            if (!validatorReresult.IsValid)
            {
                throw new DomainException(validatorReresult);
            }
        }
        /// <summary>
        ///异步验证
        /// </summary>
        public static async Task DoValidationAsync(IOrderDetailRespository orderDetailRespository, IEnumerable <OrderDetail> orderDetails, string validatorType)
        {
            var orderDetailValidator = new OrderDetailValidator(orderDetailRespository);
            var domainException      = new DomainException();

            foreach (var orderDetail in orderDetails)
            {
                var validatorReresult = await orderDetailValidator.DoValidateAsync(orderDetail, validatorType);

                if (!validatorReresult.IsValid)
                {
                    domainException.AddErrors(validatorReresult);
                }
            }

            if (domainException.ValidationErrors.ErrorItems.Any())
            {
                throw domainException;
            }
        }
        /// <summary>
        ///异步验证
        /// </summary>
        private async Task DoValidationAsync(IEnumerable <OrderDetail> OrderDetails, string validatorType)
        {
            var OrderDetailValidator = new OrderDetailValidator();
            var domainException      = new DomainException();

            foreach (var OrderDetail in OrderDetails)
            {
                var validatorReresult = await OrderDetailValidator.DoValidateAsync(OrderDetail, validatorType);

                if (!validatorReresult.IsValid)
                {
                    domainException.AddErrors(validatorReresult);
                }
            }

            if (domainException.ValidationErrors.ErrorItems.Any())
            {
                throw domainException;
            }
        }