Пример #1
0
        public bool InitalizeExpressions()
        {
            bool result = false;

            if (!IsValid)
            {
                return(false);
            }

            try
            {
                if (TypeExpression != null && TypeExpression != "")
                {
                    typeRegex = new Regex(TypeExpression, RegexOptions.Compiled, new TimeSpan(0, 0, 0, 1));
                }

                if (AttributeExpression != null && AttributeExpression != "")
                {
                    attributeRegex = new Regex(AttributeExpression, RegexOptions.Compiled, new TimeSpan(0, 0, 0, 1));
                }

                result = true;
            }
            catch (Exception ex)
            {
                ValidationFailures.Add(ex.Message);
            }

            return(result);
        }
Пример #2
0
        public IRequestValidationResult AddValidationFailure(string property, string message)
        {
            ValidationFailures.Add(new Failure()
            {
                Message  = message,
                Property = property
            });

            return(this);
        }
Пример #3
0
 public DomainRuleException(string name, string message)
 {
     ValidationFailures.Add(new ValidationFailure(name, message));
 }
Пример #4
0
 public IRequestValidationResult AddValidationFailure(Failure failure)
 {
     ValidationFailures.Add(failure);
     return(this);
 }