Class ValidationContext
provides a way to manipulate the validation failures of the current endpoint context. call Instance to obtain an instance of the current validation context.
Inherited Members
Namespace: FastEndpoints
Assembly: FastEndpoints.dll
Syntax
public class ValidationContext
Properties
Instance
provides a way to manipulate the validation failures of the current endpoint context. call Instance to obtain an instance of the current validation context.
Declaration
public static ValidationContext Instance { get; }
Property Value
Type | Description |
---|---|
ValidationContext |
ValidationFailed
provides a way to manipulate the validation failures of the current endpoint context. call Instance to obtain an instance of the current validation context.
Declaration
public bool ValidationFailed { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
ValidationFailures
provides a way to manipulate the validation failures of the current endpoint context. call Instance to obtain an instance of the current validation context.
Declaration
public List<ValidationFailure> ValidationFailures { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<FluentValidation.Results.ValidationFailure> |
Methods
AddError(ValidationFailure)
provides a way to manipulate the validation failures of the current endpoint context. call Instance to obtain an instance of the current validation context.
Declaration
public void AddError(ValidationFailure failure)
Parameters
Type | Name | Description |
---|---|---|
FluentValidation.Results.ValidationFailure | failure |
AddError(String, String, Severity)
provides a way to manipulate the validation failures of the current endpoint context. call Instance to obtain an instance of the current validation context.
Declaration
public void AddError(string message, string errorCode = null, Severity severity = Severity.Error)
Parameters
Type | Name | Description |
---|---|---|
System.String | message | |
System.String | errorCode | |
FluentValidation.Severity | severity |
ThrowError(ValidationFailure)
provides a way to manipulate the validation failures of the current endpoint context. call Instance to obtain an instance of the current validation context.
Declaration
public void ThrowError(ValidationFailure failure)
Parameters
Type | Name | Description |
---|---|---|
FluentValidation.Results.ValidationFailure | failure |
ThrowError(String)
provides a way to manipulate the validation failures of the current endpoint context. call Instance to obtain an instance of the current validation context.
Declaration
public void ThrowError(string message)
Parameters
Type | Name | Description |
---|---|---|
System.String | message |
ThrowIfAnyErrors()
provides a way to manipulate the validation failures of the current endpoint context. call Instance to obtain an instance of the current validation context.
Declaration
public void ThrowIfAnyErrors()