CustomizeValidatorAttribute
Assembly: ServiceStack.Mvc.dll
View Source
public class CustomizeValidatorAttribute : CustomModelBinderAttribute
Properties
RuleSet
Specifies the ruleset which should be used when executing this validator. This can be a comma separated list of rulesets. The string "*" can be used to indicate all rulesets. The string "default" can be used to specify those rules not in an explict ruleset.
View Source
public string RuleSet { get; set; }
Properties
Specifies a whitelist of properties that should be validated, as a comma-separated list.
View Source
public string Properties { get; set; }
Interceptor
Specifies an interceptor that can be used to customize the validation process.
View Source
public Type Interceptor { get; set; }
Skip
Indicates whether this model should skip being validated. The default is false.
View Source
public bool Skip { get; set; }
Methods
GetBinder()
View Source
public override IModelBinder GetBinder()
Returns
IModelBinder
BindModel(ControllerContext, ModelBindingContext)
View Source
public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
Returns
System.Object
Parameters
Type | Name |
---|---|
ControllerContext | controllerContext |
ModelBindingContext | bindingContext |
GetFromControllerContext(ControllerContext)
View Source
public static CustomizeValidatorAttribute GetFromControllerContext(ControllerContext context)
Returns
ServiceStack.FluentValidation.Mvc.CustomizeValidatorAttribute
Parameters
Type | Name |
---|---|
ControllerContext | context |
ToValidatorSelector()
Builds a validator selector from the options specified in the attribute's properties.
View Source
public IValidatorSelector ToValidatorSelector()
Returns
ServiceStack.FluentValidation.Internal.IValidatorSelector
CreateRulesetValidatorSelector(String[])
View Source
protected virtual IValidatorSelector CreateRulesetValidatorSelector(string[] ruleSets)
Returns
ServiceStack.FluentValidation.Internal.IValidatorSelector
Parameters
Type | Name |
---|---|
System.String[] | ruleSets |
CreateMemberNameValidatorSelector(String[])
View Source
protected virtual IValidatorSelector CreateMemberNameValidatorSelector(string[] properties)
Returns
ServiceStack.FluentValidation.Internal.IValidatorSelector
Parameters
Type | Name |
---|---|
System.String[] | properties |
CreateDefaultValidatorSelector()
View Source
protected virtual IValidatorSelector CreateDefaultValidatorSelector()
Returns
ServiceStack.FluentValidation.Internal.IValidatorSelector
GetInterceptor()
View Source
public IValidatorInterceptor GetInterceptor()
Returns
ServiceStack.FluentValidation.Mvc.IValidatorInterceptor
Implements
IModelBinder