using System;
using System.Threading;
using System.Threading.Tasks;
namespace GB5Shared.DALCache
{
public interface IDALCache
{
///
/// Returns a cached result for if present; otherwise invokes
/// , stores the result, and returns it.
/// Null factory results are not stored — they are returned as-is so the next request
/// can retry without serving a stale null.
///
Task GetOrSetAsync(
string cacheKey,
Func> factory,
int ttlSeconds,
CancellationToken ct = default) where T : class;
///
/// Removes the cached entry for .
/// Call from BLL after any write that invalidates this key.
///
Task InvalidateAsync(string cacheKey, CancellationToken ct = default);
}
}