SweetLib/SweetLib.Storage/IIdGenerator.cs

23 lines
613 B
C#
Raw Normal View History

2022-11-15 22:12:50 +01:00
using System.Threading.Tasks;
namespace SweetLib.Storage
{
/// <summary>
/// Generates a new object id.
/// </summary>
/// <typeparam name="T">Type of the used identifier.</typeparam>
public interface IIdGenerator<T>
{
/// <summary>
/// Generates a new id of the specified type.
/// </summary>
/// <returns></returns>
T GenerateNewId();
/// <summary>
/// Generates a new id of the specified type. Runs asynchronous.
/// </summary>
/// <returns></returns>
Task<T> GenerateNewIdAsync();
}
}