Register IOC container to self
问题 Let's say I have an interface IDependencyResolver: public interface IDependencyResolver{ T Resolve<T>() where T: class; object Resolve(Type source); } And an implementation with the use of SimpleInjector: public class SIDependencyResolver:IDependencyResolver{ private readonly Container _container; public SIDependencyResolver(Container container){ _container = container; _container.Options.DefaultScopedLifestyle = new WcfOperationLifeStyle(); RegisterDependencies(_container, LifeStyle.Scoped);