ValidationResultExtension
Assembly: ServiceStack.Mvc.dll
View Source
Declaration
public static class ValidationResultExtension
Methods
AddToModelState(ValidationResult, ModelStateDictionary, String)
Stores the errors in a ValidationResult object to the specified modelstate dictionary.
View Source
Declaration
public static void AddToModelState(this ValidationResult result, ModelStateDictionary modelState, string prefix)
Parameters
Type | Name | Description |
---|---|---|
ServiceStack.FluentValidation.Results.ValidationResult | result | The validation result to store |
|
| ModelStateDictionary
| modelState | The ModelStateDictionary to store the errors in.
|
| System.String
| prefix | An optional prefix. If ommitted, the property names will be the keys. If specified, the prefix will be concatenatd to the property name with a period. Eg "user.Name"
|
SetRulesetForClientsideMessages(ControllerContext, String[])
Sets the rulests used when generating clientside messages.
View Source
Declaration
public static void SetRulesetForClientsideMessages(this ControllerContext context, params string[] ruleSets)
Parameters
Type | Name | Description |
---|---|---|
ControllerContext | context | Http context |
|
| System.String[]
| ruleSets | Array of ruleset names
|