dotnet-cqrs/OpenHarbor.CQRS.Abstractions/ICommandHandler.cs

16 lines
459 B
C#
Raw Normal View History

using System.Threading;
using System.Threading.Tasks;
namespace OpenHarbor.CQRS.Abstractions;
public interface ICommandHandler<in TCommand>
where TCommand : class
{
Task HandleAsync(TCommand command, CancellationToken cancellationToken = default);
}
public interface ICommandHandler<in TCommand, TCommandResult>
where TCommand : class
{
Task<TCommandResult> HandleAsync(TCommand command, CancellationToken cancellationToken = default);
}