public void Add <TResponse>(SingleResponse <TResponse> response) { if (response != null) { if (response.IsOk) { Infos.Add(response.Message); Infos = Infos.Select(x => x).Distinct().ToList(); } else { if (response.Validations.Any()) { Validations.AddRange(response.Validations); } else { Errors.Add(response.Message); Errors = Errors.Select(x => x).Distinct().ToList(); } } } else { Errors.Add(ZeroCodes.WRN_00_00); } }
/// <summary> /// Adds a range of validation rules. /// </summary> /// <param name="rule">Validation rules.</param> /// <returns>ValidatableObject.</returns> public ValidatableObject <T> AddRules(IEnumerable <IValidationRule <T> > rule) { Validations.AddRange(rule); return(this); }
public InvalidParameterException(IEnumerable <string> validations) : base(Messages.InvalidParameterException) { Code = "00001"; Validations.AddRange(validations); }
public ValidationResult(IEnumerable <Validation> collection) { Validations.AddRange(collection); }