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
InjectablePropertyType
Open generic type that describes the injectable member type.
Type InjectablePropertyType { get; }
Property Value
MemberKeyProvider
Specifies a delegate which allows to provide a custom locator key for members.
Func<MemberInfo, object?>? MemberKeyProvider { get; }
Property Value
OptionalDependencyAttributeType
Type of an attribute that describes an optional dependency.
Type OptionalDependencyAttributeType { get; }
Property Value
TreatCaptiveDependenciesAsErrors
Specifies whether captive dependencies should be treated as errors instead of warnings.
bool TreatCaptiveDependenciesAsErrors { get; }
Property Value
VerifyOpenGenericArgumentConstraints
Specifies whether open generic registrations should verify if their implementor types don't add more generic argument constraints.
bool VerifyOpenGenericArgumentConstraints { get; }
Property Value
Methods
EnableOpenGenericArgumentConstraintsVerification(bool)
Sets the VerifyOpenGenericArgumentConstraints of this instance.
IDependencyContainerConfigurationBuilder EnableOpenGenericArgumentConstraintsVerification(bool enabled = true)
Parameters
enabledboolValue to set. Equal to true by default.
Returns
EnableTreatingCaptiveDependenciesAsErrors(bool)
Sets the TreatCaptiveDependenciesAsErrors of this instance.
IDependencyContainerConfigurationBuilder EnableTreatingCaptiveDependenciesAsErrors(bool enabled = true)
Parameters
enabledboolValue to set. Equal to true by default.
Returns
SetConstructorParameterKeyProvider(Func<ParameterInfo, object?>?)
Sets the ConstructorParameterKeyProvider of this instance.
IDependencyContainerConfigurationBuilder SetConstructorParameterKeyProvider(Func<ParameterInfo, object?>? provider)
Parameters
providerFunc<ParameterInfo, object>Provider to set.
Returns
SetInjectablePropertyType(Type)
Sets the InjectablePropertyType of this instance.
IDependencyContainerConfigurationBuilder SetInjectablePropertyType(Type openGenericType)
Parameters
openGenericTypeTypeType to set.
Returns
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
providerFunc<MemberInfo, object>Provider to set.
Returns
SetOptionalDependencyAttributeType(Type)
Sets the OptionalDependencyAttributeType of this instance.
IDependencyContainerConfigurationBuilder SetOptionalDependencyAttributeType(Type attributeType)
Parameters
attributeTypeTypeType to set.
Returns
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.