public Context RegisterFactory <T>(DependencyFactory <T> factory) { ThrowIfNull(factory, "factory"); Type dependencyType = typeof(T); Type factoryType = factory.GetType(); SingleDependency selfDependency = new SingleDependency(factory); InsertDependency(factoryType, selfDependency); FactoryDependency <T> factoryDependency = new FactoryDependency <T>(selfDependency); InsertDependency(dependencyType, factoryDependency); return(this); }