public void ResolveAll() { Container simpleContainer = new Container(); SimpleInjectorAnyContainer anyContainer = new SimpleInjectorAnyContainer(simpleContainer); simpleContainer.Collection.Register <ILogger>(typeof(Logger), typeof(AlternateLogger)); IList <ILogger> loggers = anyContainer.ResolveAll <ILogger>(); Assert.AreEqual(2, loggers.Count); Assert.AreNotEqual(loggers[0], loggers[1]); }
/// <summary> /// Adds the web request scope to the container. /// </summary> /// <param name="anyContainer">The container to add to.</param> /// <param name="nativeContainer">The native container to use.</param> public static void AddWebRequestScope(this SimpleInjectorAnyContainer anyContainer, Container nativeContainer) { anyContainer.AddScope(Lifetime.WebRequest, new SimpleInjectorWebRequestScopeRegistrar(nativeContainer)); }