Search Results for

    Show / Hide Table of Contents

    Class CommandHandler<TCommand, TResult>

    inherit this base class if you'd like to manipulate validation state of the calling endpoint from within the command handler.

    Inheritance
    object
    ValidationContext
    ValidationContext<TCommand>
    CommandHandlerBase<TCommand>
    CommandHandler<TCommand, TResult>
    Implements
    ICommandHandler<TCommand, TResult>
    ICommandHandler
    Inherited Members
    ValidationContext<TCommand>.Instance
    ValidationContext<TCommand>.AddError(Expression<Func<TCommand, object>>, string, string, Severity)
    ValidationContext<TCommand>.ThrowError(Expression<Func<TCommand, object>>, string, int?)
    ValidationContext<TCommand>.ThrowError(Expression<Func<TCommand, object>>, string, string, Severity, int?)
    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 abstract class CommandHandler<TCommand, TResult> : CommandHandlerBase<TCommand>, ICommandHandler<TCommand, TResult>, ICommandHandler where TCommand : ICommand<TResult>
    Type Parameters
    Name Description
    TCommand

    the type of the command that will be handled by this command handler

    TResult

    the type of the result that will be returned by this command handler

    Methods

    ExecuteAsync(TCommand, CancellationToken)

    receives a command and returns a result.

    Declaration
    public abstract Task<TResult> ExecuteAsync(TCommand command, CancellationToken ct = default)
    Parameters
    Type Name Description
    TCommand command

    the input command object

    CancellationToken ct

    optional cancellation token

    Returns
    Type Description
    Task<TResult>

    Implements

    ICommandHandler<TCommand, TResult>
    ICommandHandler

    Extension Methods

    CommandExtensions.RegisterForTesting<TCommand, TResult>(ICommandHandler<TCommand, TResult>)
    In this article
    Back to top Developed by Đĵ ΝιΓΞΗΛψΚ and contributors / Licensed under MIT / Website generated by DocFX