Beispiel #1
0
        public bool IsValid(T subject)
        {
            var isLeftValid  = leftValidator.IsValid(subject);
            var isRightValid = rightValidator.IsValid(subject);

            return(isLeftValid && isRightValid);
        }
Beispiel #2
0
        public static bool Validate(this IValidate validatable)
        {
            if (validatable == null)
            {
                return(false);
            }

            return(validatable.IsValid());
        }
Beispiel #3
0
        public void ProcessOrder(Order order)
        {
            if (!_orderValidator.IsValid(order))
            {
                throw new ValidationException(String.Join("\r\n", _orderValidator.GetValidationMessages(order)));
            }


            _orderRepository.AddOrder(order);

            // Event - order processed
            _orderProcessedEvent.OrderCompleted(order);
        }
        /// <summary>
        /// Check to see if enough valid information is available to include
        /// this in the open market payload.
        /// </summary>
        /// <returns>Indicates whether or not this media type can be included in the payload.</returns>
        public bool IsAvailable()
        {
            if (string.IsNullOrEmpty(this.url))
            {
                return(false);
            }

            IValidate validator = ValidatorFactory.DefaultInstance().AcquireValidator("expression");

            if (!validator.IsValid("VRE_URL", this.url))
            {
                return(false);
            }

            return(true);
        }
Beispiel #5
0
 public bool IsValid(T subject) => leftValidator.IsValid(subject) || rightValidator.IsValid(subject);