Table of Contents

Class CommandHandlerProviders

Namespace
Cratis.Applications.Commands
Assembly
Cratis.Applications.dll

Represents an implementation of ICommandHandlerProviders.

[Singleton]
public class CommandHandlerProviders : ICommandHandlerProviders
Inheritance
CommandHandlerProviders
Implements
Inherited Members

Constructors

CommandHandlerProviders(IInstancesOf<ICommandHandlerProvider>)

Initializes a new instance of the CommandHandlerProviders class.

public CommandHandlerProviders(IInstancesOf<ICommandHandlerProvider> providers)

Parameters

providers IInstancesOf<ICommandHandlerProvider>

The collection of ICommandHandlerProvider to use for providing command handlers.

Properties

Handlers

Gets the collection of command handlers.

public IEnumerable<ICommandHandler> Handlers { get; }

Property Value

IEnumerable<ICommandHandler>

Methods

TryGetHandlerFor(object, out ICommandHandler?)

Tries to get a handler for the given command.

public bool TryGetHandlerFor(object command, out ICommandHandler? handler)

Parameters

command object

Command to handle.

handler ICommandHandler

Handler for the command, if found.

Returns

bool

True if a handler was found; otherwise, false.