2021-03-22 12:09:25 -04:00
|
|
|
|
using System;
|
2021-08-26 18:35:05 -04:00
|
|
|
|
using System.Threading;
|
2021-03-22 12:09:25 -04:00
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
|
|
|
|
|
namespace Data.Abstractions
|
|
|
|
|
{
|
|
|
|
|
public interface IDataValueCache<T, V> where T : class
|
|
|
|
|
{
|
2021-08-26 18:35:05 -04:00
|
|
|
|
void SetCacheItem(Func<DbSet<T>, CancellationToken, Task<V>> itemGetter, string keyName, TimeSpan? expirationTime = null);
|
|
|
|
|
Task<V> GetCacheItem(string keyName, CancellationToken token = default);
|
2021-03-22 12:09:25 -04:00
|
|
|
|
}
|
|
|
|
|
}
|