/// <summary> /// Gets the object from the store /// </summary> /// <typeparam name="T">Type of the object to retrieve</typeparam> /// <param name="HandleName">Name from which to retrieve the object</param> /// <returns>Object from the store</returns> /// <exception cref="ArgumentException">Thrown when the HandleName is (empty)</exception> /// <exception cref="Exception">Thrown when the given Handle is not found in the store</exception> private static T GetFromStoreOrThrow <T>(string HandleName, out IStoredObject <T> storedObj) where T : class { HandleName = HandleNames.GetNameFrom(HandleName); if (String.IsNullOrWhiteSpace(HandleName)) { throw new ArgumentException($"Invalid Handle name {HandleName}", nameof(HandleName)); } if (!m_ObjectStore.GetByName <T>(HandleName, out storedObj)) { throw new Exception($"No object {typeof(T).FullName} with handle named {HandleName} found"); } return(storedObj.Object); }