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"); }
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"); }
protected abstract TLifeTime GetLifetime(IDependencyCollection services, LifeTimes lifeTime);