Skip to main content

ValidationExtensions

Assembly: ServiceStack.dll
View Source
Declaration
public static class ValidationExtensions

Properties

RegisteredDtoValidators

View Source
Declaration
public static HashSet<Type> RegisteredDtoValidators { get; }

Methods

Init(Assembly[])

View Source
Declaration
public static void Init(Assembly[] assemblies)
Parameters
TypeName
System.Reflection.Assembly[]assemblies

RegisterValidators(Container, Assembly[])

Auto-scans the provided assemblies for a ServiceStack.FluentValidation.IValidator and registers it in the provided IoC container.

View Source
Declaration
public static void RegisterValidators(this Container container, params Assembly[] assemblies)
Parameters
TypeNameDescription
Funq.ContainercontainerThe IoC container

| | System.Reflection.Assembly[] | assemblies | The assemblies to scan for a validator

|

RegisterValidators(Container, ReuseScope, Assembly[])

View Source
Declaration
public static void RegisterValidators(this Container container, ReuseScope scope, params Assembly[] assemblies)
Parameters
TypeName
Funq.Containercontainer
Funq.ReuseScopescope
System.Reflection.Assembly[]assemblies

RegisterValidator(Container, Type, ReuseScope)

View Source
Declaration
public static void RegisterValidator(this Container container, Type validator, ReuseScope scope = ReuseScope.None)
Parameters
TypeName
Funq.Containercontainer
System.Typevalidator
Funq.ReuseScopescope

HasAsyncValidators(IValidator, IValidationContext, String)

View Source
Declaration
public static bool HasAsyncValidators(this IValidator validator, IValidationContext context, string ruleSet = null)
Returns

System.Boolean

Parameters
TypeName
ServiceStack.FluentValidation.IValidatorvalidator
ServiceStack.FluentValidation.IValidationContextcontext
System.StringruleSet

GetAllValidateRulesAsync(IResolver, String)

View Source
Declaration
public static Task<List<ValidationRule>> GetAllValidateRulesAsync(this IResolver resolver, string type = null)
Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<ServiceStack.ValidationRule>>

Parameters
TypeName
ServiceStack.Configuration.IResolverresolver
System.Stringtype

GetAllValidateRulesAsync(IValidationSource, String)

View Source
Declaration
public static async Task<List<ValidationRule>> GetAllValidateRulesAsync(this IValidationSource validationSource, string type = null)
Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<ServiceStack.ValidationRule>>

Parameters
TypeName
ServiceStack.IValidationSourcevalidationSource
System.Stringtype

IsAuthValidator(IValidateRule)

View Source
Declaration
public static bool IsAuthValidator(this IValidateRule rule)
Returns

System.Boolean

Parameters
TypeName
ServiceStack.IValidateRulerule

ApplyValidationRules(Operation, IEnumerable<ValidationRule>)

View Source
Declaration
public static Operation ApplyValidationRules(this Operation op, IEnumerable<ValidationRule> rules)
Returns

ServiceStack.Host.Operation

Parameters
TypeName
ServiceStack.Host.Operationop
System.Collections.Generic.IEnumerable<ServiceStack.ValidationRule>rules

ToScriptMethodType(ScriptMethodInfo)

View Source
Declaration
public static ScriptMethodType ToScriptMethodType(this ScriptMethodInfo scriptMethod)
Returns

ServiceStack.ScriptMethodType

Parameters
TypeName
ServiceStack.Script.ScriptMethodInfoscriptMethod