ContainerConfiguration
Represents a container configuration
using Stashbox.Lifetime;
using Stashbox.Registration.Fluent;
using Stashbox.Utils.Data;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Reflection;
using System.Runtime.CompilerServices;
namespace Stashbox.Configuration
{
[System.Runtime.CompilerServices.NullableContext(1)]
[System.Runtime.CompilerServices.Nullable(0)]
public class ContainerConfiguration
{
public bool TrackTransientsForDisposalEnabled { get; set; }
public Rules.RegistrationBehavior RegistrationBehavior { get; set; }
public bool DefaultValueInjectionEnabled { get; set; }
public bool UnknownTypeResolutionEnabled { get; set; }
public bool AutoMemberInjectionEnabled { get; set; }
public bool RequiredMemberInjectionEnabled { get; set; } = true;
public bool TreatingParameterAndMemberNameAsDependencyNameEnabled { get; set; }
public bool NamedDependencyResolutionForUnNamedRequestsEnabled { get; set; }
public bool ReBuildSingletonsInChildContainerEnabled { get; set; }
public Rules.AutoMemberInjectionRules AutoMemberInjectionRule { get; set; }
public Func<IEnumerable<ConstructorInfo>, IEnumerable<ConstructorInfo>> ConstructorSelectionRule { get; set; } = Rules.ConstructorSelection.PreferMostParameters;
[System.Runtime.CompilerServices.Nullable(new byte[] {
2,
1
})]
[field: System.Runtime.CompilerServices.Nullable(new byte[] {
2,
1
})]
public Action<UnknownRegistrationConfigurator> UnknownTypeConfigurator {
[return: System.Runtime.CompilerServices.Nullable(new byte[] {
2,
1
})]
get;
[param: System.Runtime.CompilerServices.Nullable(new byte[] {
2,
1
})]
internal set;
}
[System.Runtime.CompilerServices.Nullable(new byte[] {
2,
1
})]
[field: System.Runtime.CompilerServices.Nullable(new byte[] {
2,
1
})]
public Action<ContainerConfiguration> ConfigurationChangedEvent {
[return: System.Runtime.CompilerServices.Nullable(new byte[] {
2,
1
})]
get;
[param: System.Runtime.CompilerServices.Nullable(new byte[] {
2,
1
})]
internal set;
}
[System.Runtime.CompilerServices.Nullable(new byte[] {
2,
1
})]
[field: System.Runtime.CompilerServices.Nullable(new byte[] {
2,
1
})]
public Func<MemberInfo, bool> AutoMemberInjectionFilter {
[return: System.Runtime.CompilerServices.Nullable(new byte[] {
2,
1
})]
get;
[param: System.Runtime.CompilerServices.Nullable(new byte[] {
2,
1
})]
internal set;
}
public LifetimeDescriptor DefaultLifetime { get; set; } = Lifetimes.Transient;
public bool LifetimeValidationEnabled { get; set; }
public bool VariantGenericTypesEnabled { get; set; } = true;
[System.Runtime.CompilerServices.Nullable(2)]
[field: System.Runtime.CompilerServices.Nullable(2)]
internal object UniversalName {
[System.Runtime.CompilerServices.NullableContext(2)]
get;
[System.Runtime.CompilerServices.NullableContext(2)]
set;
}
[System.Runtime.CompilerServices.Nullable(new byte[] {
2,
1
})]
[field: System.Runtime.CompilerServices.Nullable(new byte[] {
2,
1
})]
internal ExpandableArray<Type> AdditionalDependencyNameAttributeTypes {
[return: System.Runtime.CompilerServices.Nullable(new byte[] {
2,
1
})]
get;
[param: System.Runtime.CompilerServices.Nullable(new byte[] {
2,
1
})]
set;
}
[System.Runtime.CompilerServices.Nullable(new byte[] {
2,
1
})]
[field: System.Runtime.CompilerServices.Nullable(new byte[] {
2,
1
})]
internal ExpandableArray<Type> AdditionalDependencyAttributeTypes {
[return: System.Runtime.CompilerServices.Nullable(new byte[] {
2,
1
})]
get;
[param: System.Runtime.CompilerServices.Nullable(new byte[] {
2,
1
})]
set;
}
[System.Runtime.CompilerServices.Nullable(new byte[] {
2,
1,
1
})]
[field: System.Runtime.CompilerServices.Nullable(new byte[] {
2,
1,
1
})]
public Func<LambdaExpression, Delegate> ExternalExpressionCompiler {
[return: System.Runtime.CompilerServices.Nullable(new byte[] {
2,
1,
1
})]
get;
[param: System.Runtime.CompilerServices.Nullable(new byte[] {
2,
1,
1
})]
internal set;
}
internal ContainerConfiguration()
{
}
private ContainerConfiguration(bool trackTransientsForDisposalEnabled, Rules.RegistrationBehavior registrationBehavior, bool defaultValueInjectionEnabled, bool unknownTypeResolutionEnabled, bool autoMemberInjectionEnabled, bool treatingParameterAndMemberNameAsDependencyNameEnabled, bool namedDependencyResolutionForUnNamedRequestsEnabled, bool reBuildSingletonsInChildContainerEnabled, bool variantGenericTypesEnabled, Rules.AutoMemberInjectionRules autoMemberInjectionRule, Func<IEnumerable<ConstructorInfo>, IEnumerable<ConstructorInfo>> constructorSelectionRule, [System.Runtime.CompilerServices.Nullable(new byte[] {
2,
1
})] Action<UnknownRegistrationConfigurator> unknownTypeConfigurator, [System.Runtime.CompilerServices.Nullable(new byte[] {
2,
1
})] Action<ContainerConfiguration> configurationChangedEvent, [System.Runtime.CompilerServices.Nullable(new byte[] {
2,
1
})] Func<MemberInfo, bool> autoMemberInjectionFilter, LifetimeDescriptor defaultLifetime, bool lifetimeValidationEnabled, [System.Runtime.CompilerServices.Nullable(new byte[] {
2,
1,
1
})] Func<LambdaExpression, Delegate> externalExpressionCompiler, [System.Runtime.CompilerServices.Nullable(2)] object universalName, [System.Runtime.CompilerServices.Nullable(new byte[] {
2,
1
})] ExpandableArray<Type> additionalDependencyNameAttributeTypes, [System.Runtime.CompilerServices.Nullable(new byte[] {
2,
1
})] ExpandableArray<Type> additionalDependencyAttributeTypes)
{
TrackTransientsForDisposalEnabled = trackTransientsForDisposalEnabled;
RegistrationBehavior = registrationBehavior;
DefaultValueInjectionEnabled = defaultValueInjectionEnabled;
UnknownTypeResolutionEnabled = unknownTypeResolutionEnabled;
AutoMemberInjectionEnabled = autoMemberInjectionEnabled;
TreatingParameterAndMemberNameAsDependencyNameEnabled = treatingParameterAndMemberNameAsDependencyNameEnabled;
NamedDependencyResolutionForUnNamedRequestsEnabled = namedDependencyResolutionForUnNamedRequestsEnabled;
ReBuildSingletonsInChildContainerEnabled = reBuildSingletonsInChildContainerEnabled;
VariantGenericTypesEnabled = variantGenericTypesEnabled;
AutoMemberInjectionRule = autoMemberInjectionRule;
ConstructorSelectionRule = constructorSelectionRule;
UnknownTypeConfigurator = unknownTypeConfigurator;
ConfigurationChangedEvent = configurationChangedEvent;
AutoMemberInjectionFilter = autoMemberInjectionFilter;
DefaultLifetime = defaultLifetime;
LifetimeValidationEnabled = lifetimeValidationEnabled;
ExternalExpressionCompiler = externalExpressionCompiler;
UniversalName = universalName;
AdditionalDependencyNameAttributeTypes = additionalDependencyNameAttributeTypes;
AdditionalDependencyAttributeTypes = additionalDependencyAttributeTypes;
}
internal ContainerConfiguration Clone()
{
return new ContainerConfiguration(TrackTransientsForDisposalEnabled, RegistrationBehavior, DefaultValueInjectionEnabled, UnknownTypeResolutionEnabled, AutoMemberInjectionEnabled, TreatingParameterAndMemberNameAsDependencyNameEnabled, NamedDependencyResolutionForUnNamedRequestsEnabled, ReBuildSingletonsInChildContainerEnabled, VariantGenericTypesEnabled, AutoMemberInjectionRule, ConstructorSelectionRule, UnknownTypeConfigurator, ConfigurationChangedEvent, AutoMemberInjectionFilter, DefaultLifetime, LifetimeValidationEnabled, ExternalExpressionCompiler, UniversalName, AdditionalDependencyNameAttributeTypes, AdditionalDependencyAttributeTypes);
}
}
}