public bool IsValid(T subject) { var isLeftValid = leftValidator.IsValid(subject); var isRightValid = rightValidator.IsValid(subject); return(isLeftValid && isRightValid); }
public static bool Validate(this IValidate validatable) { if (validatable == null) { return(false); } return(validatable.IsValid()); }
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); }
public bool IsValid(T subject) => leftValidator.IsValid(subject) || rightValidator.IsValid(subject);