예제 #1
0
        protected override Lifestyle GetLifetime(IDependencyCollection services, LifeTimes lifeTime)
        {
            switch (lifeTime)
            {
            case LifeTimes.Transient: return(Lifestyle.Transient);

            case LifeTimes.Scoped: return(((SimpleInjectorDependencyCollection)services).Container.Options.DefaultScopedLifestyle);

            case LifeTimes.Singleton: return(Lifestyle.Singleton);
            }
            throw new ArgumentException("Invalid Lifetime");
        }
예제 #2
0
        protected override ServiceLifetime GetLifetime(IDependencyCollection services, LifeTimes lifeTime)
        {
            switch (lifeTime)
            {
            case LifeTimes.Transient: return(ServiceLifetime.Transient);

            case LifeTimes.Scoped: return(ServiceLifetime.Scoped);

            case LifeTimes.Singleton: return(ServiceLifetime.Singleton);
            }
            throw new ArgumentException("Invalid Lifetime");
        }
예제 #3
0
 protected abstract TLifeTime GetLifetime(IDependencyCollection services, LifeTimes lifeTime);