public static T Get <T>() where T : ISingletonInstance, new() { if (_instance == null) { _instance = new T(); } return((T)_instance); }
static bool TryGet(Type type, out ISingletonInstance dependency) { lock (syncRoot) { SingletonInstance instance; if (!dict.TryGetValue(type, out instance)) { dependency = null; return(false); } dependency = (ISingletonInstance)instance.Instance; return(true); } }