Open sandboxFocus

Class DependencyInjectionOptionsBuilder

Builder for configuring dependency injection options.

Inheritance
DependencyInjectionOptionsBuilder
Namespace: Metalama.Extensions.DependencyInjection
Assembly: Metalama.Extensions.DependencyInjection.dll
Syntax
[CompileTime]
public class DependencyInjectionOptionsBuilder
Remarks

Use this builder with ConfigureDependencyInjection(IQuery<ICompilation>, Action<DependencyInjectionOptionsBuilder>) to configure the dependency injection framework, set default options, and register custom DI frameworks.

Constructors

Name Description
DependencyInjectionOptionsBuilder()

Properties

Name Description
IsLazy

Sets a value indicating whether the default value for the IsLazy property of DependencyAttribute and IntroduceDependencyAttribute.

IsRequired

Sets a value indicating whether the default value for the IsRequired property of DependencyAttribute and IntroduceDependencyAttribute.

Selector

Sets a delegate that is called when several dependency injection frameworks have been registered for the current project and many vote to handle a given dependency. The default implementation is to return the first framework in the array.

Methods

Name Description
Build()
RegisterFramework<TFramework>(int)

Registers a custom dependency injection framework.

SetFrameworkPriority<TFramework>(int)

Sets the priority of a registered dependency injection framework.

UnregisterFramework<TFramework>()

Unregisters a previously registered dependency injection framework.

Extension Methods

See Also