Ejemplo n.º 1
0
 protected string FormatError(DtoValidationError error, string format)
 {
     if (error != null)
     {
         return(string.Format(format, error.Property, error.StringValue, error.Message));
     }
     else
     {
         return(Constants.DtoValidationErrorMissing);
     }
 }
Ejemplo n.º 2
0
        internal bool Validate(string name, DtoValidationError problem)
        {
            if (Validation == null)
            {
                Validation = new DtoValidation();
            }
            if (problem != null)
            {
                problem.Property = name;
                problem.Message  = string.Format(problem.Message, name);
                Validation.Add(problem);
                return(false);
            }

            return(true);
        }
Ejemplo n.º 3
0
 public void Add(DtoValidationError error)
 {
     Errors.Add(error);
 }