public object GetSingleton(Type t, object[] arguments = null) { object obj = null; try { if (_objectsPool.ContainsKey(t.Name) == false) { obj = InstanceCreationService.GetNewObject(t, arguments); _objectsPool.Add(t.Name, obj); } else { obj = _objectsPool[t.Name]; } } catch (Exception) { throw; } return(obj); }
static InstanceCreationService() { Instance = new InstanceCreationService(); }