Last active
August 29, 2015 13:56
-
-
Save devuxer/9334817 to your computer and use it in GitHub Desktop.
Suggested IModelValidationResult for Nancy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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