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
Methods
TryGetHandlerFor(object, out ICommandHandler?)
Tries to get a handler for the given command.
public bool TryGetHandlerFor(object command, out ICommandHandler? handler)
Parameters
command
objectCommand to handle.
handler
ICommandHandlerHandler for the command, if found.
Returns
- bool
True if a handler was found; otherwise, false.