Show / Hide Table of Contents

Interface ICommandRegistry

Allows command handlers to be registered

Namespace: AzureFromTheTrenches.Commanding.Abstractions
Assembly: AzureFromTheTrenches.Commanding.Abstractions.dll
Syntax
public interface ICommandRegistry

Methods

| Improve this Doc View Source

Discover(Assembly[])

Will search the specified assembly for command handlers and register them

Declaration
ICommandRegistry Discover(params Assembly[] assemblies)
Parameters
Type Name Description
Assembly[] assemblies

The assemblies to search

Returns
Type Description
ICommandRegistry

The command registry for use in a fluent call style

| Improve this Doc View Source

Discover<TTypeInAssembly>()

Will search the assemly that TTypeInAssembly belongs in for command handlers and register them

Declaration
ICommandRegistry Discover<TTypeInAssembly>()
Returns
Type Description
ICommandRegistry

The command registery for use in a fluent call style

Type Parameters
Name Description
TTypeInAssembly
| Improve this Doc View Source

GetCommandDispatcherFactory(ICommand)

Gets the command dispatcher for the command

Declaration
Func<ICommandDispatcher> GetCommandDispatcherFactory(ICommand command)
Parameters
Type Name Description
ICommand command
Returns
Type Description
Func<ICommandDispatcher>

A function able to create a command dispatcher if one is registered, null if none is

| Improve this Doc View Source

GetPrioritisedCommandHandlers(ICommand)

Returns the prioritised set of command actors (first to execute is first in the collection)

Declaration
IReadOnlyCollection<IPrioritisedCommandHandler> GetPrioritisedCommandHandlers(ICommand command)
Parameters
Type Name Description
ICommand command
Returns
Type Description
IReadOnlyCollection<IPrioritisedCommandHandler>

Set of command actors

| Improve this Doc View Source

Register(Type, Int32, Func<ICommandDispatcher>)

Register an handler against a command with no expected result

Declaration
ICommandRegistry Register(Type commandHandlerType, int order = null, Func<ICommandDispatcher> dispatcherFactoryFunc = null)
Parameters
Type Name Description
Type commandHandlerType

The type of the command handler

System.Int32 order

Execution order of the handler

Func<ICommandDispatcher> dispatcherFactoryFunc

Optional command dispatcher factory function

Returns
Type Description
ICommandRegistry
| Improve this Doc View Source

Register<TCommand>(Func<ICommandDispatcher>)

Register a command with a dispatcher but no handler. Typically this is used when the command actors are known to be deferred via a queue or that are remotely executed

Declaration
ICommandRegistry Register<TCommand>(Func<ICommandDispatcher> dispatcherFactoryFunc)
    where TCommand : ICommand
Parameters
Type Name Description
Func<ICommandDispatcher> dispatcherFactoryFunc

Command dispatcher factory function

Returns
Type Description
ICommandRegistry
Type Parameters
Name Description
TCommand

The type of the command

| Improve this Doc View Source

Register<TCommandHandler>(Int32, Func<ICommandDispatcher>)

Register an handler against a command with no expected result

Declaration
ICommandRegistry Register<TCommandHandler>(int order = null, Func<ICommandDispatcher> dispatcherFactoryFunc = null)
    where TCommandHandler : ICommandHandlerBase
Parameters
Type Name Description
System.Int32 order

Execution order of the handler

Func<ICommandDispatcher> dispatcherFactoryFunc

Optional command dispatcher factory function

Returns
Type Description
ICommandRegistry
Type Parameters
Name Description
TCommandHandler

The type of the command handler

| Improve this Doc View Source

Register<TCommand, TResult>(Func<ICommandDispatcher>)

Register a command with a dispatcher but no handler. Typically this is used when the command actors are known to be deferred via a queue or that are remotely executed

Declaration
ICommandRegistry Register<TCommand, TResult>(Func<ICommandDispatcher> dispatcherFactoryFunc)
    where TCommand : ICommand<TResult>
Parameters
Type Name Description
Func<ICommandDispatcher> dispatcherFactoryFunc

Command dispatcher factory function

Returns
Type Description
ICommandRegistry
Type Parameters
Name Description
TCommand

The type of the command

TResult

The type of the result

| Improve this Doc View Source

Remove<TCommandHandler>()

Removes the registered command handler

Declaration
ICommandRegistry Remove<TCommandHandler>()
    where TCommandHandler : ICommandHandler
Returns
Type Description
ICommandRegistry

The command registry for use in a fluent call style

Type Parameters
Name Description
TCommandHandler

The type of the command handler

| Improve this Doc View Source

RemoveDispatcher<TCommand>()

Removes any assigned dispatcher from a command

Declaration
ICommandRegistry RemoveDispatcher<TCommand>()
    where TCommand : ICommand
Returns
Type Description
ICommandRegistry

The command registry for use in a fluent call style

Type Parameters
Name Description
TCommand

The type of the command

| Improve this Doc View Source

RemoveHandlers<TCommand>()

Removes all handlers for the registered command

Declaration
ICommandRegistry RemoveHandlers<TCommand>()
    where TCommand : ICommand
Returns
Type Description
ICommandRegistry

The command registry for use in a fluent call style

Type Parameters
Name Description
TCommand

The type of the command

Extension Methods

ICommandRegistryExtensions.RegisterHttpCommand<TCommand, TResult>(ICommandRegistry, Uri, HttpMethod, Func<String>, IHttpCommandSerializer, IUriCommandQueryBuilder, HttpDispatchErrorHandler)
  • Improve this Doc
  • View Source
  • 0 Comments
Back to top Copyright © 2018 James Randall