Interface IDependencyImplementorBuilder
- Namespace
- LfrlAnvil.Dependencies
- Assembly
- LfrlAnvil.Dependencies.dll
Represents a dependency implementor resolution builder.
public interface IDependencyImplementorBuilder
- Extension Methods
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
Factory
Explicit creator of this implementor's instances.
Func<IDependencyScope, object>? Factory { 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.
IDependencyImplementorBuilder FromConstructor(Action<IDependencyConstructorInvocationOptions>? configuration = null)
Parameters
configuration
Action<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.
IDependencyImplementorBuilder FromConstructor(ConstructorInfo info, Action<IDependencyConstructorInvocationOptions>? configuration = null)
Parameters
info
ConstructorInfoConstructor to use for creating implementor instances.
configuration
Action<IDependencyConstructorInvocationOptions>Optional configurator of the constructor invocation.
Returns
FromFactory(Func<IDependencyScope, object>)
Specifies that this implementor's instances should be created by the provided explicit factory
.
IDependencyImplementorBuilder FromFactory(Func<IDependencyScope, object> factory)
Parameters
factory
Func<IDependencyScope, object>Explicit creator of implementor instances.
Returns
FromType(Type, Action<IDependencyConstructorInvocationOptions>?)
Specifies that this implementor's instances should be created
by the best suited constructor of the provided type
.
IDependencyImplementorBuilder FromType(Type type, Action<IDependencyConstructorInvocationOptions>? configuration = null)
Parameters
type
TypeImplementor's type.
configuration
Action<IDependencyConstructorInvocationOptions>Optional configurator of the constructor invocation.
Returns
SetDisposalStrategy(DependencyImplementorDisposalStrategy)
Sets the DisposalStrategy of this instance.
IDependencyImplementorBuilder SetDisposalStrategy(DependencyImplementorDisposalStrategy strategy)
Parameters
strategy
DependencyImplementorDisposalStrategyStrategy to set.
Returns
SetOnResolvingCallback(Action<Type, IDependencyScope>?)
Sets the OnResolvingCallback for this instance.
IDependencyImplementorBuilder SetOnResolvingCallback(Action<Type, IDependencyScope>? callback)
Parameters
callback
Action<Type, IDependencyScope>Delegate to set.