Show / Hide Table of Contents

Interface ICommandingRuntime

Represents a runtime for the commanding system. Manages some shared configuration.

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

Methods

| Improve this Doc View Source

AddAuditItemEnricher<TAuditItemEnricher>(ICommandingDependencyResolverAdapter)

Adds an audit item enricher

Declaration
ICommandingDependencyResolverAdapter AddAuditItemEnricher<TAuditItemEnricher>(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
ICommandRegistry AddCommanding(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, IOptions)

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
ICommandRegistry AddCommanding(ICommandingDependencyResolverAdapter dependencyResolver, IOptions options = null)
Parameters
Type Name Description
ICommandingDependencyResolverAdapter dependencyResolver

The dependency resolver to register inside

IOptions 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
ICommandingDependencyResolverAdapter AddExecutionCommandingAuditor<TExecutionAuditorImpl>(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
ICommandingDependencyResolverAdapter AddPostDispatchCommandingAuditor<TDispatchAuditorImpl>(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
ICommandingDependencyResolverAdapter AddPreDispatchCommandingAuditor<TDispatchAuditorImpl>(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)

Registers a type that will add additional properties to audit items

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

The dependency resolver

Returns
Type Description
ICommandingDependencyResolver

The dependency resolver

Type Parameters
Name Description
TAuditItemEnricher

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
ICommandRegistry UseCommanding(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, IOptions)

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
ICommandRegistry UseCommanding(ICommandingDependencyResolver dependencyResolver, IOptions options = null)
Parameters
Type Name Description
ICommandingDependencyResolver dependencyResolver

The dependency resolver to register inside

IOptions 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
ICommandingDependencyResolver UseExecutionCommandingAuditor<TExecutionAuditorImpl>(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
ICommandingDependencyResolver UsePostDispatchCommandingAuditor<TDispatchAuditorImpl>(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
ICommandingDependencyResolver UsePreDispatchCommandingAuditor<TDispatchAuditorImpl>(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