Table of Contents

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

IDependencyConstructor

DisposalStrategy

Disposal strategy of this implementor's instances. See DependencyImplementorDisposalStrategy for more information.

DependencyImplementorDisposalStrategy DisposalStrategy { get; }

Property Value

DependencyImplementorDisposalStrategy

Factory

Explicit creator of this implementor's instances.

Func<IDependencyScope, object>? Factory { get; }

Property Value

Func<IDependencyScope, object>

ImplementorType

Implementor's type.

Type ImplementorType { get; }

Property Value

Type

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

Action<Type, IDependencyScope>

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

IDependencyImplementorBuilder

this.

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 ConstructorInfo

Constructor to use for creating implementor instances.

configuration Action<IDependencyConstructorInvocationOptions>

Optional configurator of the constructor invocation.

Returns

IDependencyImplementorBuilder

this.

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

IDependencyImplementorBuilder

this.

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 Type

Implementor's type.

configuration Action<IDependencyConstructorInvocationOptions>

Optional configurator of the constructor invocation.

Returns

IDependencyImplementorBuilder

this.

SetDisposalStrategy(DependencyImplementorDisposalStrategy)

Sets the DisposalStrategy of this instance.

IDependencyImplementorBuilder SetDisposalStrategy(DependencyImplementorDisposalStrategy strategy)

Parameters

strategy DependencyImplementorDisposalStrategy

Strategy to set.

Returns

IDependencyImplementorBuilder

this.

SetOnResolvingCallback(Action<Type, IDependencyScope>?)

Sets the OnResolvingCallback for this instance.

IDependencyImplementorBuilder SetOnResolvingCallback(Action<Type, IDependencyScope>? callback)

Parameters

callback Action<Type, IDependencyScope>

Delegate to set.

Returns

IDependencyImplementorBuilder

this.