Skip to content

Instantly share code, notes, and snippets.

@devuxer
Last active August 29, 2015 13:56
Show Gist options
  • Save devuxer/9334817 to your computer and use it in GitHub Desktop.
Save devuxer/9334817 to your computer and use it in GitHub Desktop.
Suggested IModelValidationResult for Nancy
public interface IModelValidationResult
{
public IEnumerable<ModelValidationError> ModelErrors { get; set; }
// one error per pair/group of properties -> show ModelErrorMesssage in error summary list
public IDictionary<string, ModelValidationError> PropertyErrors { get; set; }
// on error per property -> turn property red and show PropertyErrorMessage next to property
// note: would include only the *first* error encountered for each property
public IDictionary<string, IList<ModelValidationError>> GroupedPropertyErrors { get; set; }
// one or more errors for each property -> turn property red and show PropertyErrorMessages list below/next to property
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment