Files
xDataService/Interfaces/IXKeyGenerator.cs
T
2026-05-08 04:30:04 +03:30

26 lines
709 B
C#

using System.Threading;
using System.Threading.Tasks;
using xModels.Base;
namespace xDataService.Interfaces
{
/// <summary>
/// Non Generic Key Generator Interface ...
/// </summary>
public interface IXKeyGenerator { }
/// <summary>
/// Typed Base Key Generator ...
/// </summary>
/// <typeparam name="TEntity"></typeparam>
/// <typeparam name="TKey"></typeparam>
public interface IXKeyGenerator<TEntity, TKey> : IXKeyGenerator
where TEntity : XBaseEntity<TKey>
{
bool IsEmpty(TKey id);
Task<TKey> GenerateKey(
IXBaseRepository<TEntity, TKey> repository,
CancellationToken cancellationToken = default
);
}
}