Skip to main content

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
TypeName
ServiceStack.IAppHostappHost

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
TypeNameDescription
ServiceStack.IAppHostappHostThe app host

|

AfterPluginsLoaded(IAppHost)

View Source
Declaration
public void AfterPluginsLoaded(IAppHost appHost)
Parameters
TypeName
ServiceStack.IAppHostappHost

AfterInit(IAppHost)

View Source
Declaration
public void AfterInit(IAppHost appHost)
Parameters
TypeName
ServiceStack.IAppHostappHost

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
TypeName
System.Objectrequest

ValidateRequest(Object, IRequest)

View Source
Declaration
public virtual void ValidateRequest(object requestDto, IRequest req)
Parameters
TypeName
System.ObjectrequestDto
ServiceStack.Web.IRequestreq

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
TypeName
System.ObjectrequestDto
ServiceStack.Web.IRequestreq
System.Threading.CancellationTokentoken

Implements