public T Get <T>() where T : class { if (!IsInitilized) { Init(); } Type instanceType = typeof(T); if (Singletons.ContainsKey(instanceType)) { return((T)Singletons[instanceType]); } if (Factories.ContainsKey(instanceType)) { return((T)Factories[instanceType].Invoke()); } if (AsyncFactories.ContainsKey(instanceType)) { return((T)AsyncFactories[instanceType].Invoke().Result); } return(null); }
public T Single <T>() { if (Singletons.ContainsKey(typeof(T))) { return((T)Singletons[typeof(T)]); } return(default(T)); }