Table of Contents

Interface IOpenGenericDependencyRangeBuilder

Namespace
LfrlAnvil.Dependencies
Assembly
LfrlAnvil.Dependencies.dll

Represents an open generic dependency range resolution builder.

public interface IOpenGenericDependencyRangeBuilder

Properties

ClosedBuilders

Collection of all closed type IDependencyRangeBuilder instances associated with this range.

IReadOnlyList<IDependencyRangeBuilder> ClosedBuilders { get; }

Property Value

IReadOnlyList<IDependencyRangeBuilder>

DependencyType

Element type.

Type DependencyType { get; }

Property Value

Type

Elements

Collection of all IOpenGenericDependencyBuilder instances associated with this range.

IReadOnlyList<IOpenGenericDependencyBuilder> Elements { get; }

Property Value

IReadOnlyList<IOpenGenericDependencyBuilder>

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

Add()

Creates a new IOpenGenericDependencyBuilder instance and registers it in this range.

IOpenGenericDependencyBuilder Add()

Returns

IOpenGenericDependencyBuilder

New IOpenGenericDependencyBuilder instance.

SetOnResolvingCallback(Action<Type, IDependencyScope>?)

Sets the OnResolvingCallback for this instance.

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

Parameters

callback Action<Type, IDependencyScope>

Delegate to set.

Returns

IOpenGenericDependencyRangeBuilder

this.

TryGetLast()

Gets the last IOpenGenericDependencyBuilder instance registered in this range.

[Pure]
IOpenGenericDependencyBuilder? TryGetLast()

Returns

IOpenGenericDependencyBuilder

IOpenGenericDependencyBuilder instance of the last registered element or null when this range is empty.