Table of Contents

Interface IDependencyContainerConfigurationBuilder

Namespace
LfrlAnvil.Dependencies
Assembly
LfrlAnvil.Dependencies.dll

Represents a builder of dependency container configuration.

public interface IDependencyContainerConfigurationBuilder

Properties

ConstructorParameterKeyProvider

Specifies a delegate which allows to provide a custom locator key for constructor parameters.

Func<ParameterInfo, object?>? ConstructorParameterKeyProvider { get; }

Property Value

Func<ParameterInfo, object>

InjectablePropertyType

Open generic type that describes the injectable member type.

Type InjectablePropertyType { get; }

Property Value

Type

MemberKeyProvider

Specifies a delegate which allows to provide a custom locator key for members.

Func<MemberInfo, object?>? MemberKeyProvider { get; }

Property Value

Func<MemberInfo, object>

OptionalDependencyAttributeType

Type of an attribute that describes an optional dependency.

Type OptionalDependencyAttributeType { get; }

Property Value

Type

TreatCaptiveDependenciesAsErrors

Specifies whether captive dependencies should be treated as errors instead of warnings.

bool TreatCaptiveDependenciesAsErrors { get; }

Property Value

bool

VerifyOpenGenericArgumentConstraints

Specifies whether open generic registrations should verify if their implementor types don't add more generic argument constraints.

bool VerifyOpenGenericArgumentConstraints { get; }

Property Value

bool

Methods

EnableOpenGenericArgumentConstraintsVerification(bool)

Sets the VerifyOpenGenericArgumentConstraints of this instance.

IDependencyContainerConfigurationBuilder EnableOpenGenericArgumentConstraintsVerification(bool enabled = true)

Parameters

enabled bool

Value to set. Equal to true by default.

Returns

IDependencyContainerConfigurationBuilder

this.

EnableTreatingCaptiveDependenciesAsErrors(bool)

Sets the TreatCaptiveDependenciesAsErrors of this instance.

IDependencyContainerConfigurationBuilder EnableTreatingCaptiveDependenciesAsErrors(bool enabled = true)

Parameters

enabled bool

Value to set. Equal to true by default.

Returns

IDependencyContainerConfigurationBuilder

this.

SetConstructorParameterKeyProvider(Func<ParameterInfo, object?>?)

Sets the ConstructorParameterKeyProvider of this instance.

IDependencyContainerConfigurationBuilder SetConstructorParameterKeyProvider(Func<ParameterInfo, object?>? provider)

Parameters

provider Func<ParameterInfo, object>

Provider to set.

Returns

IDependencyContainerConfigurationBuilder

this.

SetInjectablePropertyType(Type)

Sets the InjectablePropertyType of this instance.

IDependencyContainerConfigurationBuilder SetInjectablePropertyType(Type openGenericType)

Parameters

openGenericType Type

Type to set.

Returns

IDependencyContainerConfigurationBuilder

this.

Exceptions

DependencyContainerBuilderConfigurationException

When the provided type is not an open generic type or contains more than one generic argument or does not have a constructor that accepts a single parameter of the generic argument type.

SetMemberKeyProvider(Func<MemberInfo, object?>?)

Sets the MemberKeyProvider of this instance.

IDependencyContainerConfigurationBuilder SetMemberKeyProvider(Func<MemberInfo, object?>? provider)

Parameters

provider Func<MemberInfo, object>

Provider to set.

Returns

IDependencyContainerConfigurationBuilder

this.

SetOptionalDependencyAttributeType(Type)

Sets the OptionalDependencyAttributeType of this instance.

IDependencyContainerConfigurationBuilder SetOptionalDependencyAttributeType(Type attributeType)

Parameters

attributeType Type

Type to set.

Returns

IDependencyContainerConfigurationBuilder

this.

Exceptions

DependencyContainerBuilderConfigurationException

When the provided type is a generic type definition or does not extend the Attribute type or is not valid on parameters and fields and properties.