Skip to main content

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
TypeNameDescription
ServiceStack.FluentValidation.Results.ValidationResultresultThe 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
TypeNameDescription
ControllerContextcontextHttp context

| | System.String[] | ruleSets | Array of ruleset names

|