Skip to main content

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​
TypeName
System.Typetype

HasValidateAttributes(Type)​

View Source​
Declaration
public static bool HasValidateAttributes(Type type)
Returns​

System.Boolean

Parameters​
TypeName
System.Typetype

AssertTypeValidatorsAsync(IRequest, Object, Type)​

View Source​
Declaration
public static async Task AssertTypeValidatorsAsync(IRequest req, object requestDto, Type requestType)
Returns​

System.Threading.Tasks.Task

Parameters​
TypeName
ServiceStack.Web.IRequestreq
System.ObjectrequestDto
System.TyperequestType

RegisterRequestRulesFor(Type)​

View Source​
Declaration
public static bool RegisterRequestRulesFor(Type type)
Returns​

System.Boolean

Parameters​
TypeName
System.Typetype

ParseCondition(ScriptContext, String)​

View Source​
Declaration
public static SharpPage ParseCondition(ScriptContext context, string condition)
Returns​

ServiceStack.Script.SharpPage

Parameters​
TypeName
ServiceStack.Script.ScriptContextcontext
System.Stringcondition

AddTypeValidator(List<ITypeValidator>, IValidateRule)​

View Source​
Declaration
public static void AddTypeValidator(List<ITypeValidator> to, IValidateRule attr)
Parameters​
TypeName
System.Collections.Generic.List<ServiceStack.ITypeValidator>to
ServiceStack.IValidateRuleattr

RegisterPropertyRulesFor(Type)​

Register declarative property [Validate] attributes.

View Source​
Declaration
public static bool RegisterPropertyRulesFor(Type type)
Returns​

System.Boolean

Parameters​
TypeName
System.Typetype

GetTypeRules(Type)​

View Source​
Declaration
public static List<ITypeValidator> GetTypeRules(Type type)
Returns​

System.Collections.Generic.List<ServiceStack.ITypeValidator>

Parameters​
TypeName
System.Typetype

GetPropertyRules(Type)​

View Source​
Declaration
public static List<IValidationRule> GetPropertyRules(Type type)
Returns​

System.Collections.Generic.List<ServiceStack.FluentValidation.IValidationRule>

Parameters​
TypeName
System.Typetype

AddRule(Type, String, ValidateAttribute)​

View Source​
Declaration
public static void AddRule(Type type, string name, ValidateAttribute attr)
Parameters​
TypeName
System.Typetype
System.Stringname
ServiceStack.ValidateAttributeattr

AddRule(Type, PropertyInfo, ValidateAttribute)​

View Source​
Declaration
public static void AddRule(Type type, PropertyInfo pi, ValidateAttribute attr)
Parameters​
TypeName
System.Typetype
System.Reflection.PropertyInfopi
ServiceStack.ValidateAttributeattr

CreatePropertyRule(Type, PropertyInfo)​

View Source​
Declaration
public static IValidationRule CreatePropertyRule(Type type, PropertyInfo pi)
Returns​

ServiceStack.FluentValidation.IValidationRule

Parameters​
TypeName
System.Typetype
System.Reflection.PropertyInfopi

CreateCollectionPropertyRule(Type, PropertyInfo)​

View Source​
Declaration
public static IValidationRule CreateCollectionPropertyRule(Type type, PropertyInfo pi)
Returns​

ServiceStack.FluentValidation.IValidationRule

Parameters​
TypeName
System.Typetype
System.Reflection.PropertyInfopi

AppendDefaultValueOnEmptyValidators(PropertyInfo, IValidateRule)​

View Source​
Declaration
public static void AppendDefaultValueOnEmptyValidators(PropertyInfo pi, IValidateRule rule)
Parameters​
TypeName
System.Reflection.PropertyInfopi
ServiceStack.IValidateRulerule

AddRule(List<IPropertyValidator>, PropertyInfo, IValidateRule)​

View Source​
Declaration
public static void AddRule(this List<IPropertyValidator> validators, PropertyInfo pi, IValidateRule propRule)
Parameters​
TypeName
System.Collections.Generic.List<ServiceStack.FluentValidation.Validators.IPropertyValidator>validators
System.Reflection.PropertyInfopi
ServiceStack.IValidateRulepropRule

ToPageResult(PropertyValidatorContext, SharpPage)​

View Source​
Declaration
public static PageResult ToPageResult(this PropertyValidatorContext context, SharpPage page)
Returns​

ServiceStack.Script.PageResult

Parameters​
TypeName
ServiceStack.FluentValidation.Validators.PropertyValidatorContextcontext
ServiceStack.Script.SharpPagepage