ValidationFeature
Assembly: ServiceStack.dll
View Source
Declaration
public class ValidationFeature : IPlugin, IPreInitPlugin, IPostInitPlugin, IAfterInitAppHost, IHasStringId, IHasId<string>
Properties
Id
View Source
Declaration
public string Id { get; set; }
ErrorResponseFilter
View Source
Declaration
public Func<IRequest, ValidationResult, object, object> ErrorResponseFilter { get; set; }
ScanAppHostAssemblies
View Source
Declaration
public bool ScanAppHostAssemblies { get; set; }
TreatInfoAndWarningsAsErrors
View Source
Declaration
public bool TreatInfoAndWarningsAsErrors { get; set; }
EnableDeclarativeValidation
View Source
Declaration
public bool EnableDeclarativeValidation { get; set; }
ImplicitlyValidateChildProperties
View Source
Declaration
public bool ImplicitlyValidateChildProperties { get; set; }
AccessRole
View Source
Declaration
public string AccessRole { get; set; }
ValidationSource
View Source
Declaration
public IValidationSource ValidationSource { get; set; }
ServiceRoutes
View Source
Declaration
public Dictionary<Type, string[]> ServiceRoutes { get; set; }
ConditionErrorCodes
Specify default ErrorCodes to use when custom validation conditions are invalid
View Source
Declaration
public Dictionary<string, string> ConditionErrorCodes { get; }
ErrorCodeMessages
Specify default Error Messages to use when Validators with these ErrorCode's are invalid
View Source
Declaration
public Dictionary<string, string> ErrorCodeMessages { get; }
Methods
BeforePluginsLoaded(IAppHost)
View Source
Declaration
public void BeforePluginsLoaded(IAppHost appHost)
Parameters
Type | Name |
---|---|
ServiceStack.IAppHost | appHost |
Register(IAppHost)
Activate the validation mechanism, so every request DTO with an existing validator will be validated.
View Source
Declaration
public void Register(IAppHost appHost)
Parameters
Type | Name | Description |
---|---|---|
ServiceStack.IAppHost | appHost | The app host |
|
AfterPluginsLoaded(IAppHost)
View Source
Declaration
public void AfterPluginsLoaded(IAppHost appHost)
Parameters
Type | Name |
---|---|
ServiceStack.IAppHost | appHost |
AfterInit(IAppHost)
View Source
Declaration
public void AfterInit(IAppHost appHost)
Parameters
Type | Name |
---|---|
ServiceStack.IAppHost | appHost |
GetRequestErrorBody(Object)
Override to provide additional/less context about the Service Exception. By default the request is serialized and appended to the ResponseStatus StackTrace.
View Source
Declaration
public virtual string GetRequestErrorBody(object request)
Returns
System.String
Parameters
Type | Name |
---|---|
System.Object | request |
ValidateRequest(Object, IRequest)
View Source
Declaration
public virtual void ValidateRequest(object requestDto, IRequest req)
Parameters
Type | Name |
---|---|
System.Object | requestDto |
ServiceStack.Web.IRequest | req |
ValidateRequestAsync(Object, IRequest, CancellationToken)
View Source
Declaration
public virtual async Task ValidateRequestAsync(object requestDto, IRequest req, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
System.Object | requestDto |
ServiceStack.Web.IRequest | req |
System.Threading.CancellationToken | token |