private static ComponentRegistration<object> InitializeLifeStyle(IComponent component, ComponentRegistration<object> componentFor) { switch (component.LifeStyle) { case (LifeStyle.Singleton): return componentFor.LifestyleSingleton(); case (LifeStyle.Transient): return componentFor.LifestyleTransient(); case (LifeStyle.WebRequest): return componentFor.LifestylePerWebRequest(); case (LifeStyle.Pooled): return componentFor.LifestylePooled(); default: throw new ContainerException("LifeStyle not allowed " + component.LifeStyle); } }