Show / Hide Table of Contents

Class CommandingDependencies

Extension methods for registering commanding dependencies

Inheritance
System.Object
CommandingDependencies
Namespace: AzureFromTheTrenches.Commanding
Assembly: AzureFromTheTrenches.Commanding.dll
Syntax
public static class CommandingDependencies : object

Methods

| Improve this Doc View Source

AddAuditItemEnricher<TAuditItemEnricher>(ICommandingDependencyResolverAdapter)

Adds an audit item enricher

Declaration
public static ICommandingDependencyResolverAdapter AddAuditItemEnricher<TAuditItemEnricher>(this ICommandingDependencyResolverAdapter commandingDependencyResolver)
    where TAuditItemEnricher : IAuditItemEnricher
Parameters
Type Name Description
ICommandingDependencyResolverAdapter commandingDependencyResolver

The commanding dependency resolver

Returns
Type Description
ICommandingDependencyResolverAdapter

The commanding dependency resolver

Type Parameters
Name Description
TAuditItemEnricher

The type of the enricher

| Improve this Doc View Source

AddCommanding(ICommandingDependencyResolverAdapter, Action<Type>)

Registers the commanding system in an ioc container. If the container is not able to resolve unregistered types (for example the NetStandard Microsoft container) then the commandHandlerContainerRegistration should be used to perform the type registration for the handler

Declaration
public static ICommandRegistry AddCommanding(this ICommandingDependencyResolverAdapter dependencyResolver, Action<Type> commandHandlerContainerRegistration)
Parameters
Type Name Description
ICommandingDependencyResolverAdapter dependencyResolver

The dependency resolver to register inside

Action<Type> commandHandlerContainerRegistration

Unless an alternative implementation of ICommandHandlerFactory is supplied then actors are created through the dependency resolver but not all IoC containers can resolve unregistered concrete types (for example the built in ASP.Net Core IServiceCollection and IServiceProvider IoC cannot). Where this is the case supply an implementation for the CommandHandlerContainerRegistration action that registers the actors in the container. For example using an IServiceCollection instance of serviceCollection: resolver.UseCommanding(type => services.AddTransient(type, type));

Returns
Type Description
ICommandRegistry

The dependency resolver

| Improve this Doc View Source

AddCommanding(ICommandingDependencyResolverAdapter, Options)

Registers the commanding system in an ioc container. If the container is not able to resolve unregistered types (for example the NetStandard Microsoft container) then the commandHandlerContainerRegistration should be used to perform the type registration for the handler

Declaration
public static ICommandRegistry AddCommanding(this ICommandingDependencyResolverAdapter dependencyResolver, Options options = null)
Parameters
Type Name Description
ICommandingDependencyResolverAdapter dependencyResolver

The dependency resolver to register inside

Options options

Configuration options for the commanding system

Returns
Type Description
ICommandRegistry

The dependency resolver

| Improve this Doc View Source

AddExecutionCommandingAuditor<TExecutionAuditorImpl>(ICommandingDependencyResolverAdapter, Boolean)

Registers an auditor that will be invoked directly after a command has been executed.

Declaration
public static ICommandingDependencyResolverAdapter AddExecutionCommandingAuditor<TExecutionAuditorImpl>(this ICommandingDependencyResolverAdapter dependencyResolver, bool auditRootCommandOnly = true)
    where TExecutionAuditorImpl : ICommandAuditor
Parameters
Type Name Description
ICommandingDependencyResolverAdapter dependencyResolver

The dependency resolver

System.Boolean auditRootCommandOnly

By default the built in auditor will audit every command that is dispatched however if using the audit as part of an event sourcing pipeline it can be useful to only audit the root command and exclude any commands dispatched as a result of that root command. Set this property to true to audit only the root commands, leave null or set to false to audit all commands.

Returns
Type Description
ICommandingDependencyResolverAdapter

The dependency resolver

Type Parameters
Name Description
TExecutionAuditorImpl

The type of the auditor

| Improve this Doc View Source

AddPostDispatchCommandingAuditor<TDispatchAuditorImpl>(ICommandingDependencyResolverAdapter, Boolean)

Registers an auditor that will be invoked directly after a command has been dispatched.

Declaration
public static ICommandingDependencyResolverAdapter AddPostDispatchCommandingAuditor<TDispatchAuditorImpl>(this ICommandingDependencyResolverAdapter dependencyResolver, bool auditRootCommandOnly = true)
    where TDispatchAuditorImpl : ICommandAuditor
Parameters
Type Name Description
ICommandingDependencyResolverAdapter dependencyResolver

The dependency resolver

System.Boolean auditRootCommandOnly

By default the built in auditor will audit every command that is dispatched however if using the audit as part of an event sourcing pipeline it can be useful to only audit the root command and exclude any commands dispatched as a result of that root command. Set this property to true to audit only the root commands, leave null or set to false to audit all commands.

Returns
Type Description
ICommandingDependencyResolverAdapter

The dependency resolver

Type Parameters
Name Description
TDispatchAuditorImpl

The type of the auditor

| Improve this Doc View Source

AddPreDispatchCommandingAuditor<TDispatchAuditorImpl>(ICommandingDependencyResolverAdapter, Boolean)

Registers an auditor that will be invoked directly before a command has been dispatched.

Declaration
public static ICommandingDependencyResolverAdapter AddPreDispatchCommandingAuditor<TDispatchAuditorImpl>(this ICommandingDependencyResolverAdapter dependencyResolver, bool auditRootCommandOnly = true)
    where TDispatchAuditorImpl : ICommandAuditor
Parameters
Type Name Description
ICommandingDependencyResolverAdapter dependencyResolver

The dependency resolver

System.Boolean auditRootCommandOnly

By default the built in auditor will audit every command that is dispatched however if using the audit as part of an event sourcing pipeline it can be useful to only audit the root command and exclude any commands dispatched as a result of that root command. Set this property to true to audit only the root commands, leave null or set to false to audit all commands.

Returns
Type Description
ICommandingDependencyResolverAdapter

The dependency resolver

Type Parameters
Name Description
TDispatchAuditorImpl

The type of the auditor

| Improve this Doc View Source

UseAuditItemEnricher<TAuditItemEnricher>(ICommandingDependencyResolver)

Adds an audit item enricher

Declaration
public static ICommandingDependencyResolver UseAuditItemEnricher<TAuditItemEnricher>(this ICommandingDependencyResolver commandingDependencyResolver)
    where TAuditItemEnricher : IAuditItemEnricher
Parameters
Type Name Description
ICommandingDependencyResolver commandingDependencyResolver

The commanding dependency resolver

Returns
Type Description
ICommandingDependencyResolver

The commanding dependency resolver

Type Parameters
Name Description
TAuditItemEnricher

The type of the enricher

| Improve this Doc View Source

UseCommanding(ICommandingDependencyResolver, Action<Type>)

Registers the commanding system in an ioc container. If the container is not able to resolve unregistered types (for example the NetStandard Microsoft container) then the commandHandlerContainerRegistration should be used to perform the type registration for the handler

Declaration
public static ICommandRegistry UseCommanding(this ICommandingDependencyResolver dependencyResolver, Action<Type> commandHandlerContainerRegistration)
Parameters
Type Name Description
ICommandingDependencyResolver dependencyResolver

The dependency resolver to register inside

Action<Type> commandHandlerContainerRegistration

Unless an alternative implementation of ICommandHandlerFactory is supplied then actors are created through the dependency resolver but not all IoC containers can resolve unregistered concrete types (for example the built in ASP.Net Core IServiceCollection and IServiceProvider IoC cannot). Where this is the case supply an implementation for the CommandHandlerContainerRegistration action that registers the actors in the container. For example using an IServiceCollection instance of serviceCollection: resolver.UseCommanding(type => services.AddTransient(type, type));

Returns
Type Description
ICommandRegistry

The dependency resolver

| Improve this Doc View Source

UseCommanding(ICommandingDependencyResolver, Options)

Registers the commanding system in an ioc container. If the container is not able to resolve unregistered types (for example the NetStandard Microsoft container) then the commandHandlerContainerRegistration should be used to perform the type registration for the handler

Declaration
public static ICommandRegistry UseCommanding(this ICommandingDependencyResolver dependencyResolver, Options options = null)
Parameters
Type Name Description
ICommandingDependencyResolver dependencyResolver

The dependency resolver to register inside

Options options

Configuration options for the commanding system

Returns
Type Description
ICommandRegistry

The dependency resolver

| Improve this Doc View Source

UseExecutionCommandingAuditor<TExecutionAuditorImpl>(ICommandingDependencyResolver, Boolean)

Registers an auditor that will be invoked directly after a command has been executed.

Declaration
public static ICommandingDependencyResolver UseExecutionCommandingAuditor<TExecutionAuditorImpl>(this ICommandingDependencyResolver dependencyResolver, bool auditRootCommandOnly = true)
    where TExecutionAuditorImpl : ICommandAuditor
Parameters
Type Name Description
ICommandingDependencyResolver dependencyResolver

The dependency resolver

System.Boolean auditRootCommandOnly

By default the built in auditor will audit every command that is dispatched however if using the audit as part of an event sourcing pipeline it can be useful to only audit the root command and exclude any commands dispatched as a result of that root command. Set this property to true to audit only the root commands, leave null or set to false to audit all commands.

Returns
Type Description
ICommandingDependencyResolver

The dependency resolver

Type Parameters
Name Description
TExecutionAuditorImpl

The type of the auditor

| Improve this Doc View Source

UsePostDispatchCommandingAuditor<TDispatchAuditorImpl>(ICommandingDependencyResolver, Boolean)

Registers an auditor that will be invoked directly after a command has been dispatched.

Declaration
public static ICommandingDependencyResolver UsePostDispatchCommandingAuditor<TDispatchAuditorImpl>(this ICommandingDependencyResolver dependencyResolver, bool auditRootCommandOnly = true)
    where TDispatchAuditorImpl : ICommandAuditor
Parameters
Type Name Description
ICommandingDependencyResolver dependencyResolver

The dependency resolver

System.Boolean auditRootCommandOnly

By default the built in auditor will audit every command that is dispatched however if using the audit as part of an event sourcing pipeline it can be useful to only audit the root command and exclude any commands dispatched as a result of that root command. Set this property to true to audit only the root commands, leave null or set to false to audit all commands.

Returns
Type Description
ICommandingDependencyResolver

The dependency resolver

Type Parameters
Name Description
TDispatchAuditorImpl

The type of the auditor

| Improve this Doc View Source

UsePreDispatchCommandingAuditor<TDispatchAuditorImpl>(ICommandingDependencyResolver, Boolean)

Registers an auditor that will be invoked directly before a command has been dispatched.

Declaration
public static ICommandingDependencyResolver UsePreDispatchCommandingAuditor<TDispatchAuditorImpl>(this ICommandingDependencyResolver dependencyResolver, bool auditRootCommandOnly = true)
    where TDispatchAuditorImpl : ICommandAuditor
Parameters
Type Name Description
ICommandingDependencyResolver dependencyResolver

The dependency resolver

System.Boolean auditRootCommandOnly

By default the built in auditor will audit every command that is dispatched however if using the audit as part of an event sourcing pipeline it can be useful to only audit the root command and exclude any commands dispatched as a result of that root command. Set this property to true to audit only the root commands, leave null or set to false to audit all commands.

Returns
Type Description
ICommandingDependencyResolver

The dependency resolver

Type Parameters
Name Description
TDispatchAuditorImpl

The type of the auditor

  • Improve this Doc
  • View Source
  • 0 Comments
Back to top Copyright © 2018 James Randall