Search Results for

    Show / Hide Table of Contents

    Class CommandHandler<TCommand>

    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>
    Implements
    ICommandHandler<TCommand>
    ICommandHandler<TCommand, Void>
    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> : CommandHandlerBase<TCommand>, ICommandHandler<TCommand>, ICommandHandler<TCommand, Void>, ICommandHandler where TCommand : ICommand
    Type Parameters
    Name Description
    TCommand

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

    Methods

    ExecuteAsync(TCommand, CancellationToken)

    accepts a command and does not return a result.

    Declaration
    public abstract Task 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

    Implements

    ICommandHandler<TCommand>
    ICommandHandler<TCommand, TResult>
    ICommandHandler

    Extension Methods

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