Interface IDependencyRangeBuilder
- Namespace
- LfrlAnvil.Dependencies
- Assembly
- LfrlAnvil.Dependencies.dll
Represents a dependency range resolution builder.
public interface IDependencyRangeBuilder
Properties
DependencyType
Element type.
Type DependencyType { get; }
Property Value
Elements
Collection of all IDependencyBuilder instances associated with this range.
IReadOnlyList<IDependencyBuilder> Elements { 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
Add()
Creates a new IDependencyBuilder instance and registers it in this range.
IDependencyBuilder Add()
Returns
- IDependencyBuilder
New IDependencyBuilder instance.
SetOnResolvingCallback(Action<Type, IDependencyScope>?)
Sets the OnResolvingCallback for this instance.
IDependencyRangeBuilder SetOnResolvingCallback(Action<Type, IDependencyScope>? callback)
Parameters
callback
Action<Type, IDependencyScope>Delegate to set.
Returns
- IDependencyRangeBuilder
this.
TryGetLast()
Gets the last IDependencyBuilder instance registered in this range.
[Pure]
IDependencyBuilder? TryGetLast()
Returns
- IDependencyBuilder
IDependencyBuilder instance of the last registered element or null when this range is empty.