Class CommandingDependencyResolverAdapter
An adapter that enables the commanding framework to be used with any IoC container
Inheritance
Implements
Namespace: AzureFromTheTrenches.Commanding.Abstractions
Assembly: AzureFromTheTrenches.Commanding.Abstractions.dll
Syntax
public class CommandingDependencyResolverAdapter : object, ICommandingDependencyResolverAdapter
Constructors
| Improve this Doc View SourceCommandingDependencyResolverAdapter(Action<Type, Object>, Action<Type, Type>, Func<Type, Object>)
Constructor
Declaration
public CommandingDependencyResolverAdapter(Action<Type, object> registerInstance, Action<Type, Type> typeMapping, Func<Type, object> resolve)
Parameters
Type | Name | Description |
---|---|---|
Action<Type, System.Object> | registerInstance | A lambda that registers a singleton / instance |
Action<Type, Type> | typeMapping | A lambda that registers a transient type |
Func<Type, System.Object> | resolve | A lambda that resolves the given type |
Properties
| Improve this Doc View SourceAssociatedCommandingRuntime
The commanding runtime associated with this adapter - this will be set by AddCommanding in the core framework
Declaration
public ICommandingRuntime AssociatedCommandingRuntime { get; set; }
Property Value
Type | Description |
---|---|
ICommandingRuntime |
Methods
| Improve this Doc View SourceRegisterInstance<TType>(TType)
Registers a singleton / instances
Declaration
public ICommandingDependencyResolverAdapter RegisterInstance<TType>(TType instance)
Parameters
Type | Name | Description |
---|---|---|
TType | instance | The instance |
Returns
Type | Description |
---|---|
ICommandingDependencyResolverAdapter | The adapter for use in a fluent API |
Type Parameters
Name | Description |
---|---|
TType | The type of the singleton |
Resolve(Type)
Resolves a type
Declaration
public object Resolve(Type type)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type to resolve |
Returns
Type | Description |
---|---|
System.Object | An implementation for the type |
Resolve<TType>()
Resolves a type
Declaration
public TType Resolve<TType>()
Returns
Type | Description |
---|---|
TType | An implementation for the type |
Type Parameters
Name | Description |
---|---|
TType | The type to resolve |
TypeMapping(Type, Type)
Registers a transient type mapping
Declaration
public ICommandingDependencyResolverAdapter TypeMapping(Type type, Type impl)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The resolvable type |
Type | impl | The implementation type |
Returns
Type | Description |
---|---|
ICommandingDependencyResolverAdapter | The adapter for use in a fluent API |
TypeMapping<TType, TImpl>()
Registers a transient type mappinig
Declaration
public ICommandingDependencyResolverAdapter TypeMapping<TType, TImpl>()
where TImpl : TType
Returns
Type | Description |
---|---|
ICommandingDependencyResolverAdapter | The adapter for use in a fluent API |
Type Parameters
Name | Description |
---|---|
TType | The resolvable type |
TImpl | The implementation type |