private T GetDependency <T>(Type type) { using (InjectionContext.NewContext()) { return(default(T)); } }
private T GetDependency <T>(string name) { using (InjectionContext.NewContext()) { InjectionProvider provider; if (this.namedProviderMap.TryGetValue(name, out provider)) { return(provider.GetInstance(this)); } throw new InvalidOperationException($"No dependency with name '{name}' defined."); } }