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 SourceAddAuditItemEnricher<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 |
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 |
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 |
| System.Action<System.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 |
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 |
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 |
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 |
UseAuditItemEnricher<TAuditItemEnricher>(ICommandingDependencyResolver)
Registers a type that will add additional properties to audit items
Declaration
[Obsolete("Please use AddAuditItemEnricher instead")]
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 |
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
[Obsolete("Please use AddCommanding instead")]
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 |
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
[Obsolete("Please use AddCommanding instead")]
ICommandRegistry UseCommanding(ICommandingDependencyResolver dependencyResolver, Action<Type> commandHandlerContainerRegistration)
Parameters
| Type | Name | Description |
|---|---|---|
| ICommandingDependencyResolver | dependencyResolver | The dependency resolver to register inside |
| System.Action<System.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 |
UseExecutionCommandingAuditor<TExecutionAuditorImpl>(ICommandingDependencyResolver, Boolean)
Registers an auditor that will be invoked directly after a command has been executed.
Declaration
[Obsolete("Please use AddExecutionCommandingAuditor instead")]
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 |
UsePostDispatchCommandingAuditor<TDispatchAuditorImpl>(ICommandingDependencyResolver, Boolean)
Registers an auditor that will be invoked directly after a command has been dispatched.
Declaration
[Obsolete("Please use AddPostDispatchCommandingAuditor instead")]
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 |
UsePreDispatchCommandingAuditor<TDispatchAuditorImpl>(ICommandingDependencyResolver, Boolean)
Registers an auditor that will be invoked directly before a command has been dispatched.
Declaration
[Obsolete("Please use AddPreDispatchCommandingAuditor instead")]
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 |