Skip to main content

CustomContext

Custom validation context

Assembly: ServiceStack.dll
View Source
Declaration
public class CustomContext : ICommonContext

Properties

Rule

View Source
Declaration
public PropertyRule Rule { get; }

PropertyName

View Source
Declaration
public string PropertyName { get; }

DisplayName

View Source
Declaration
public string DisplayName { get; }

MessageFormatter

View Source
Declaration
public MessageFormatter MessageFormatter { get; }

InstanceToValidate

View Source
Declaration
public object InstanceToValidate { get; }

PropertyValue

View Source
Declaration
public object PropertyValue { get; }

ICommonContext.ParentContext

View Source
Declaration
ICommonContext ICommonContext.ParentContext { get; }

ParentContext

View Source
Declaration
public IValidationContext ParentContext { get; }

Methods

AddFailure(String, String)

Adds a new validation failure.

View Source
Declaration
public void AddFailure(string propertyName, string errorMessage)
Parameters
TypeNameDescription
System.StringpropertyNameThe property name

| | System.String | errorMessage | The error message

|

AddFailure(String)

Adds a new validation failure (the property name is inferred)

View Source
Declaration
public void AddFailure(string errorMessage)
Parameters
TypeNameDescription
System.StringerrorMessageThe error message

|

AddFailure(ValidationFailure)

Adds a new validation failure

View Source
Declaration
public void AddFailure(ValidationFailure failure)
Parameters
TypeNameDescription
ServiceStack.FluentValidation.Results.ValidationFailurefailureThe failure to add

|

Implements