Class DependencyBuilderExtensions
- Namespace
- LfrlAnvil.Dependencies.Extensions
- Assembly
- LfrlAnvil.Dependencies.dll
Contains IDependencyBuilder extension methods.
public static class DependencyBuilderExtensions
- Inheritance
-
DependencyBuilderExtensions
- Inherited Members
Methods
FromSharedImplementor<T>(IDependencyBuilder, Action<IDependencyImplementorOptions>?)
Specifies that this dependency should be implemented through a shared implementor of the provided type.
public static IDependencyBuilder FromSharedImplementor<T>(this IDependencyBuilder builder, Action<IDependencyImplementorOptions>? configuration = null)
Parameters
builder
IDependencyBuilderSource dependency builder.
configuration
Action<IDependencyImplementorOptions>Optional configurator of the shared implementor.
Returns
- IDependencyBuilder
builder
.
Type Parameters
T
Shared implementor's type.
Remarks
Resets Implementor to null.
FromType<T>(IDependencyBuilder, Action<IDependencyConstructorInvocationOptions>?)
Specifies that this dependency should be implemented by the best suited constructor of the provided type.
public static IDependencyImplementorBuilder FromType<T>(this IDependencyBuilder builder, Action<IDependencyConstructorInvocationOptions>? configuration = null)
Parameters
builder
IDependencyBuilderSource dependency builder.
configuration
Action<IDependencyConstructorInvocationOptions>Optional configurator of the constructor invocation.
Returns
- IDependencyImplementorBuilder
builder
.
Type Parameters
T
Implementor's type.
Remarks
Resets SharedImplementorKey to null.