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
Type | Name | Description |
---|---|---|
System.String | propertyName | The 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
Type | Name | Description |
---|---|---|
System.String | errorMessage | The error message |
|
AddFailure(ValidationFailure)
Adds a new validation failure
View Source
Declaration
public void AddFailure(ValidationFailure failure)
Parameters
Type | Name | Description |
---|---|---|
ServiceStack.FluentValidation.Results.ValidationFailure | failure | The failure to add |
|