Validators
Assembly: ServiceStack.dll
View Source
Declaration
public static class Validators
Properties
TypeRulesMap
View Source
Declaration
public static Dictionary<Type, List<ITypeValidator>> TypeRulesMap { get; }
TypePropertyRulesMap
View Source
Declaration
public static Dictionary<Type, List<IValidationRule>> TypePropertyRulesMap { get; }
ConditionErrorCodes
View Source
Declaration
public static Dictionary<string, string> ConditionErrorCodes { get; }
ErrorCodeMessages
View Source
Declaration
public static Dictionary<string, string> ErrorCodeMessages { get; }
RuleFilters
View Source
Declaration
public static List<Action<PropertyInfo, IValidateRule>> RuleFilters { get; }
Methods
HasValidateRequestAttributes(Type)
View Source
Declaration
public static bool HasValidateRequestAttributes(Type type)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Type | type |
HasValidateAttributes(Type)
View Source
Declaration
public static bool HasValidateAttributes(Type type)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Type | type |
AssertTypeValidatorsAsync(IRequest, Object, Type)
View Source
Declaration
public static async Task AssertTypeValidatorsAsync(IRequest req, object requestDto, Type requestType)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
ServiceStack.Web.IRequest | req |
System.Object | requestDto |
System.Type | requestType |
RegisterRequestRulesFor(Type)
View Source
Declaration
public static bool RegisterRequestRulesFor(Type type)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Type | type |
ParseCondition(ScriptContext, String)
View Source
Declaration
public static SharpPage ParseCondition(ScriptContext context, string condition)
Returns
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptContext | context |
System.String | condition |
AddTypeValidator(List<ITypeValidator>, IValidateRule)
View Source
Declaration
public static void AddTypeValidator(List<ITypeValidator> to, IValidateRule attr)
Parameters
Type | Name |
---|---|
System.Collections.Generic.List<ServiceStack.ITypeValidator> | to |
ServiceStack.IValidateRule | attr |
RegisterPropertyRulesFor(Type)
Register declarative property [Validate] attributes.
View Source
Declaration
public static bool RegisterPropertyRulesFor(Type type)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Type | type |
GetTypeRules(Type)
View Source
Declaration
public static List<ITypeValidator> GetTypeRules(Type type)
Returns
System.Collections.Generic.List<ServiceStack.ITypeValidator>
Parameters
Type | Name |
---|---|
System.Type | type |
GetPropertyRules(Type)
View Source
Declaration
public static List<IValidationRule> GetPropertyRules(Type type)
Returns
System.Collections.Generic.List<ServiceStack.FluentValidation.IValidationRule>
Parameters
Type | Name |
---|---|
System.Type | type |
AddRule(Type, String, ValidateAttribute)
View Source
Declaration
public static void AddRule(Type type, string name, ValidateAttribute attr)
Parameters
Type | Name |
---|---|
System.Type | type |
System.String | name |
ServiceStack.ValidateAttribute | attr |
AddRule(Type, PropertyInfo, ValidateAttribute)
View Source
Declaration
public static void AddRule(Type type, PropertyInfo pi, ValidateAttribute attr)
Parameters
Type | Name |
---|---|
System.Type | type |
System.Reflection.PropertyInfo | pi |
ServiceStack.ValidateAttribute | attr |
CreatePropertyRule(Type, PropertyInfo)
View Source
Declaration
public static IValidationRule CreatePropertyRule(Type type, PropertyInfo pi)
Returns
ServiceStack.FluentValidation.IValidationRule
Parameters
Type | Name |
---|---|
System.Type | type |
System.Reflection.PropertyInfo | pi |
CreateCollectionPropertyRule(Type, PropertyInfo)
View Source
Declaration
public static IValidationRule CreateCollectionPropertyRule(Type type, PropertyInfo pi)
Returns
ServiceStack.FluentValidation.IValidationRule
Parameters
Type | Name |
---|---|
System.Type | type |
System.Reflection.PropertyInfo | pi |
AppendDefaultValueOnEmptyValidators(PropertyInfo, IValidateRule)
View Source
Declaration
public static void AppendDefaultValueOnEmptyValidators(PropertyInfo pi, IValidateRule rule)
Parameters
Type | Name |
---|---|
System.Reflection.PropertyInfo | pi |
ServiceStack.IValidateRule | rule |
AddRule(List<IPropertyValidator>, PropertyInfo, IValidateRule)
View Source
Declaration
public static void AddRule(this List<IPropertyValidator> validators, PropertyInfo pi, IValidateRule propRule)
Parameters
Type | Name |
---|---|
System.Collections.Generic.List<ServiceStack.FluentValidation.Validators.IPropertyValidator> | validators |
System.Reflection.PropertyInfo | pi |
ServiceStack.IValidateRule | propRule |
ToPageResult(PropertyValidatorContext, SharpPage)
View Source
Declaration
public static PageResult ToPageResult(this PropertyValidatorContext context, SharpPage page)
Returns
ServiceStack.Script.PageResult
Parameters
Type | Name |
---|---|
ServiceStack.FluentValidation.Validators.PropertyValidatorContext | context |
ServiceStack.Script.SharpPage | page |