private static string Dump(ValidationResults results) { var buffer = new StringBuilder(); results.ToList().ForEach(r => buffer.AppendLine("{0} => '{1}'".FormatWith(r.Key, r.Message))); return(buffer.ToString()); }
public virtual void ExecuteValidation() { ValidationResults validationResults = this.GetErrors <T>(); if (!validationResults.IsValid) { throw new CommonValidationException(validationResults.ToList <ValidationResult>()); } }
void MergeValidationResults(CommandResult commandResultToMerge) { if (commandResultToMerge.ValidationResults == null) { return; } if (ValidationResults == null) { ValidationResults = commandResultToMerge.ValidationResults; return; } var validationResults = ValidationResults.ToList(); validationResults.AddRange(commandResultToMerge.ValidationResults); ValidationResults = validationResults.ToArray(); }