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
Type | Name |
---|---|
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
Type | Name | Description |
---|---|---|
Funq.Container | container | The 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
Type | Name |
---|---|
Funq.Container | container |
Funq.ReuseScope | scope |
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
Type | Name |
---|---|
Funq.Container | container |
System.Type | validator |
Funq.ReuseScope | scope |
HasAsyncValidators(IValidator, IValidationContext, String)
View Source
Declaration
public static bool HasAsyncValidators(this IValidator validator, IValidationContext context, string ruleSet = null)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
ServiceStack.FluentValidation.IValidator | validator |
ServiceStack.FluentValidation.IValidationContext | context |
System.String | ruleSet |
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
Type | Name |
---|---|
ServiceStack.Configuration.IResolver | resolver |
System.String | type |
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
Type | Name |
---|---|
ServiceStack.IValidationSource | validationSource |
System.String | type |
IsAuthValidator(IValidateRule)
View Source
Declaration
public static bool IsAuthValidator(this IValidateRule rule)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
ServiceStack.IValidateRule | rule |
ApplyValidationRules(Operation, IEnumerable<ValidationRule>)
View Source
Declaration
public static Operation ApplyValidationRules(this Operation op, IEnumerable<ValidationRule> rules)
Returns
Parameters
Type | Name |
---|---|
ServiceStack.Host.Operation | op |
System.Collections.Generic.IEnumerable<ServiceStack.ValidationRule> | rules |
ToScriptMethodType(ScriptMethodInfo)
View Source
Declaration
public static ScriptMethodType ToScriptMethodType(this ScriptMethodInfo scriptMethod)
Returns
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptMethodInfo | scriptMethod |