private static LifetimeManager GetLifetimeManager(HandlerLifetime handlerLifetime) { switch (handlerLifetime) { case HandlerLifetime.Transient: return(new TransientLifetimeManager()); case HandlerLifetime.PerRequest: return(new HierarchicalLifetimeManager()); case HandlerLifetime.Singleton: return(new ContainerControlledLifetimeManager()); default: throw new InvalidEnumArgumentException("handlerLifetime", (int)handlerLifetime, typeof(HandlerLifetime)); } }
private static LifetimeManager GetLifetimeManager(HandlerLifetime handlerLifetime) { switch (handlerLifetime) { case HandlerLifetime.Transient: return new TransientLifetimeManager(); case HandlerLifetime.PerRequest: return new HierarchicalLifetimeManager(); case HandlerLifetime.Singleton: return new ContainerControlledLifetimeManager(); default: throw new InvalidEnumArgumentException("handlerLifetime", (int)handlerLifetime, typeof(HandlerLifetime)); } }
/// <summary> /// Initializes a new instance of the <see cref="HandlerLifetimeAttribute"/> class. /// <param name="handlerLifetime">The handler lifetime.</param> /// </summary> public HandlerLifetimeAttribute(HandlerLifetime handlerLifetime) { this.HandlerLifetime = handlerLifetime; }