ContainerConfiguration
Represents a container configuration
using Stashbox.Lifetime;
using Stashbox.Registration.Fluent;
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; }
[Obsolete("Please use parameterized factory registrations to avoid circular dependencies across delegates. `.Register<Service>(options => options.WithFactory<Dependency>(dependency => new Service(dependency)))`")]
public bool RuntimeCircularDependencyTrackingEnabled { get; set; }
public bool DefaultValueInjectionEnabled { get; set; }
public bool UnknownTypeResolutionEnabled { get; set; }
public bool AutoMemberInjectionEnabled { get; set; }
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; }
[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 runtimeCircularDependencyTrackingEnabled, bool defaultValueInjectionEnabled, bool unknownTypeResolutionEnabled, bool autoMemberInjectionEnabled, bool treatingParameterAndMemberNameAsDependencyNameEnabled, bool namedDependencyResolutionForUnNamedRequestsEnabled, bool reBuildSingletonsInChildContainerEnabled, 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)
{
TrackTransientsForDisposalEnabled = trackTransientsForDisposalEnabled;
RegistrationBehavior = registrationBehavior;
RuntimeCircularDependencyTrackingEnabled = runtimeCircularDependencyTrackingEnabled;
DefaultValueInjectionEnabled = defaultValueInjectionEnabled;
UnknownTypeResolutionEnabled = unknownTypeResolutionEnabled;
AutoMemberInjectionEnabled = autoMemberInjectionEnabled;
TreatingParameterAndMemberNameAsDependencyNameEnabled = treatingParameterAndMemberNameAsDependencyNameEnabled;
NamedDependencyResolutionForUnNamedRequestsEnabled = namedDependencyResolutionForUnNamedRequestsEnabled;
ReBuildSingletonsInChildContainerEnabled = reBuildSingletonsInChildContainerEnabled;
AutoMemberInjectionRule = autoMemberInjectionRule;
ConstructorSelectionRule = constructorSelectionRule;
UnknownTypeConfigurator = unknownTypeConfigurator;
ConfigurationChangedEvent = configurationChangedEvent;
AutoMemberInjectionFilter = autoMemberInjectionFilter;
DefaultLifetime = defaultLifetime;
LifetimeValidationEnabled = lifetimeValidationEnabled;
ExternalExpressionCompiler = externalExpressionCompiler;
}
internal ContainerConfiguration Clone()
{
return new ContainerConfiguration(TrackTransientsForDisposalEnabled, RegistrationBehavior, RuntimeCircularDependencyTrackingEnabled, DefaultValueInjectionEnabled, UnknownTypeResolutionEnabled, AutoMemberInjectionEnabled, TreatingParameterAndMemberNameAsDependencyNameEnabled, NamedDependencyResolutionForUnNamedRequestsEnabled, ReBuildSingletonsInChildContainerEnabled, AutoMemberInjectionRule, ConstructorSelectionRule, UnknownTypeConfigurator, ConfigurationChangedEvent, AutoMemberInjectionFilter, DefaultLifetime, LifetimeValidationEnabled, ExternalExpressionCompiler);
}
}
}