2021-03-22 11:09:25 -05:00
|
|
|
|
using System;
|
2021-08-26 17:35:05 -05:00
|
|
|
|
using System.Threading;
|
2021-03-22 11:09:25 -05:00
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
|
|
|
|
|
namespace Data.Abstractions
|
|
|
|
|
{
|
2021-11-15 10:25:55 -06:00
|
|
|
|
public interface IDataValueCache<TEntityType, TReturnType> where TEntityType : class
|
2021-03-22 11:09:25 -05:00
|
|
|
|
{
|
2021-11-15 10:25:55 -06:00
|
|
|
|
void SetCacheItem(Func<DbSet<TEntityType>, CancellationToken, Task<TReturnType>> itemGetter, string keyName,
|
|
|
|
|
TimeSpan? expirationTime = null, bool autoRefresh = false);
|
|
|
|
|
Task<TReturnType> GetCacheItem(string keyName, CancellationToken token = default);
|
2021-03-22 11:09:25 -05:00
|
|
|
|
}
|
|
|
|
|
}
|