Interface IOpenGenericDependencyImplementorBuilder
- Namespace
- LfrlAnvil.Dependencies
- Assembly
- LfrlAnvil.Dependencies.dll
Represents an open generic dependency implementor resolution builder.
public interface IOpenGenericDependencyImplementorBuilder
Properties
Constructor
Explicit constructor definition of this implementor's instances.
IDependencyConstructor? Constructor { get; }
Property Value
DisposalStrategy
Disposal strategy of this implementor's instances. See DependencyImplementorDisposalStrategy for more information.
DependencyImplementorDisposalStrategy DisposalStrategy { get; }
Property Value
ImplementorType
Implementor's type.
Type ImplementorType { get; }
Property Value
OnResolvingCallback
Specifies an optional callback that gets invoked right before the dependency instance is resolved. The first argument denotes the type of a dependency to resolve and the second argument is the scope that is resolving the dependency.
Action<Type, IDependencyScope>? OnResolvingCallback { get; }
Property Value
Methods
FromConstructor(Action<IDependencyConstructorInvocationOptions>?)
Specifies that this implementor's instances should be created by the best suited constructor of this implementor's type.
IOpenGenericDependencyImplementorBuilder FromConstructor(Action<IDependencyConstructorInvocationOptions>? configuration = null)
Parameters
configurationAction<IDependencyConstructorInvocationOptions>Optional configurator of the constructor invocation.
Returns
FromConstructor(ConstructorInfo, Action<IDependencyConstructorInvocationOptions>?)
Specifies that this implementor's instances should be created by the provided constructor.
IOpenGenericDependencyImplementorBuilder FromConstructor(ConstructorInfo info, Action<IDependencyConstructorInvocationOptions>? configuration = null)
Parameters
infoConstructorInfoConstructor to use for creating implementor instances.
configurationAction<IDependencyConstructorInvocationOptions>Optional configurator of the constructor invocation.
Returns
FromType(Type, Action<IDependencyConstructorInvocationOptions>?)
Specifies that this implementor's instances should be created
by the best suited constructor of the provided type.
IOpenGenericDependencyImplementorBuilder FromType(Type type, Action<IDependencyConstructorInvocationOptions>? configuration = null)
Parameters
typeTypeImplementor's type.
configurationAction<IDependencyConstructorInvocationOptions>Optional configurator of the constructor invocation.
Returns
SetDisposalStrategy(DependencyImplementorDisposalStrategy)
Sets the DisposalStrategy of this instance.
IOpenGenericDependencyImplementorBuilder SetDisposalStrategy(DependencyImplementorDisposalStrategy strategy)
Parameters
strategyDependencyImplementorDisposalStrategyStrategy to set.
Returns
SetOnResolvingCallback(Action<Type, IDependencyScope>?)
Sets the OnResolvingCallback for this instance.
IOpenGenericDependencyImplementorBuilder SetOnResolvingCallback(Action<Type, IDependencyScope>? callback)
Parameters
callbackAction<Type, IDependencyScope>Delegate to set.