Skip to main content

ValidationStrategy<T>

Assembly: ServiceStack.dll
View Source
Declaration
public class ValidationStrategy<T>

Methods

IncludeProperties(String[])

Indicates that only the specified properties should be validated.

View Source
Declaration
public ValidationStrategy<T> IncludeProperties(params string[] properties)
Returns

ServiceStack.FluentValidation.Internal.ValidationStrategy<T>

Parameters
TypeNameDescription
System.String[]propertiesThe property names to validate.

|

IncludeProperties(Expression<Func<T, Object>>[])

Indicates that only the specified properties should be validated.

View Source
Declaration
public ValidationStrategy<T> IncludeProperties(params Expression<Func<T, object>>[] propertyExpressions)
Returns

ServiceStack.FluentValidation.Internal.ValidationStrategy<T>

Parameters
TypeNameDescription
System.Linq.Expressions.Expression<System.Func<<T>,System.Object>>[]propertyExpressionsThe properties to validate, defined as expressions.

|

IncludeRulesNotInRuleSet()

Indicates that all rules not in a rule-set should be included for validation (the equivalent of calling IncludeRuleSets("default")). This method can be combined with IncludeRuleSets.

View Source
Declaration
public ValidationStrategy<T> IncludeRulesNotInRuleSet()
Returns

ServiceStack.FluentValidation.Internal.ValidationStrategy<T>

IncludeAllRuleSets()

Indicates that all rules should be executed, regardless of whether or not they're in a ruleset. This is the equivalent of IncludeRuleSets("*").

View Source
Declaration
public ValidationStrategy<T> IncludeAllRuleSets()
Returns

ServiceStack.FluentValidation.Internal.ValidationStrategy<T>

IncludeRuleSets(String[])

Indicates that only the specified rule sets should be validated.

View Source
Declaration
public ValidationStrategy<T> IncludeRuleSets(params string[] ruleSets)
Returns

ServiceStack.FluentValidation.Internal.ValidationStrategy<T>

Parameters
TypeNameDescription
System.String[]ruleSetsThe names of the rulesets to validate.

|

UseCustomSelector(IValidatorSelector)

Indicates that the specified selector should be used to control which rules are executed.

View Source
Declaration
public ValidationStrategy<T> UseCustomSelector(IValidatorSelector selector)
Returns

ServiceStack.FluentValidation.Internal.ValidationStrategy<T>

Parameters
TypeNameDescription
ServiceStack.FluentValidation.Internal.IValidatorSelectorselectorThe custom selector to use

|

ThrowOnFailures()

Indicates that the validator should throw an exception if it fails, rather than return a validation result.

View Source
Declaration
public ValidationStrategy<T> ThrowOnFailures()
Returns

ServiceStack.FluentValidation.Internal.ValidationStrategy<T>