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;
namespace Stashbox.Configuration
{
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; }
public Action<UnknownRegistrationConfigurator> UnknownTypeConfigurator { get; set; }
public Action<ContainerConfiguration> ConfigurationChangedEvent { get; set; }
public Func<MemberInfo, bool> AutoMemberInjectionFilter { get; set; }
public LifetimeDescriptor DefaultLifetime { get; set; }
public bool LifetimeValidationEnabled { get; set; }
public Func<LambdaExpression, Delegate> ExternalExpressionCompiler { get; set; }
internal static ContainerConfiguration DefaultContainerConfiguration()
{
return new ContainerConfiguration {
ConstructorSelectionRule = Rules.ConstructorSelection.PreferMostParameters,
DefaultLifetime = Lifetimes.Transient
};
}
private ContainerConfiguration()
{
}
internal ContainerConfiguration Clone()
{
return (ContainerConfiguration)MemberwiseClone();
}
}
}