Search Results for

    Show / Hide Table of Contents

    Class ValidationContext<T>

    Inheritance
    object
    ValidationContext
    ValidationContext<T>
    CommandHandlerBase<TCommand>
    Inherited Members
    ValidationContext.ValidationFailures
    ValidationContext.ValidationFailed
    ValidationContext.AddError(ValidationFailure)
    ValidationContext.AddError(string, string, Severity)
    ValidationContext.ThrowError(ValidationFailure, int?)
    ValidationContext.ThrowError(string, int?)
    ValidationContext.ThrowError(string, string, Severity, int?)
    ValidationContext.ThrowIfAnyErrors(int?)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: FastEndpoints
    Assembly: FastEndpoints.dll
    Syntax
    public class ValidationContext<T> : ValidationContext
    Type Parameters
    Name Description
    T

    Properties

    Instance

    Declaration
    public static ValidationContext<T> Instance { get; }
    Property Value
    Type Description
    ValidationContext<T>

    Methods

    AddError(Expression<Func<T, object?>>, string, string?, Severity)

    adds an error message for the specified property of the request dto

    Declaration
    public void AddError(Expression<Func<T, object?>> property, string errorMessage, string? errorCode = null, Severity severity = Severity.Error)
    Parameters
    Type Name Description
    Expression<Func<T, object>> property

    the property to add the error message for

    string errorMessage

    the error message

    string errorCode

    the error code associated with the error

    Severity severity

    the severity of the error

    ThrowError(Expression<Func<T, object?>>, string, int?)

    adds an error message for the specified property of the request dto and sends back a 400 bad request with error details immediately interrupting handler execution flow. no execution will continue past this call.

    Declaration
    public void ThrowError(Expression<Func<T, object?>> property, string errorMessage, int? statusCode = null)
    Parameters
    Type Name Description
    Expression<Func<T, object>> property

    the property to add the error message for

    string errorMessage

    the error message

    int? statusCode

    an optional status code to be used when building the error response

    ThrowError(Expression<Func<T, object?>>, string, string, Severity, int?)

    adds an error message for the specified property of the request dto and sends back a 400 bad request with error details immediately interrupting handler execution flow. no execution will continue past this call.

    Declaration
    public void ThrowError(Expression<Func<T, object?>> property, string errorMessage, string errorCode, Severity severity = Severity.Error, int? statusCode = null)
    Parameters
    Type Name Description
    Expression<Func<T, object>> property

    the property to add the error message for

    string errorMessage

    the error message

    string errorCode

    the error code associated with the error

    Severity severity

    the severity of the error

    int? statusCode

    an optional status code to be used when building the error response

    In this article
    Back to top Developed by Đĵ ΝιΓΞΗΛψΚ and contributors / Licensed under MIT / Website generated by DocFX