Table of Contents

Interface IDependencyContainerConfigurationBuilder

Namespace
LfrlAnvil.Dependencies
Assembly
LfrlAnvil.Dependencies.dll

Represents a builder of dependency container configuration.

public interface IDependencyContainerConfigurationBuilder

Properties

InjectablePropertyType

Open generic type that describes the injectable member type.

Type InjectablePropertyType { get; }

Property Value

Type

OptionalDependencyAttributeType

Type of an attribute that describes an optional dependency.

Type OptionalDependencyAttributeType { get; }

Property Value

Type

TreatCaptiveDependenciesAsErrors

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

bool TreatCaptiveDependenciesAsErrors { get; }

Property Value

bool

Methods

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.

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.

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.