Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

663 B
Raw Blame
namespace Grand.Infrastructure.Caching;

/// <summary>
///     Cache manager interface
/// </summary>
public interface ICacheBase
{
    T Get<T>(string key, Func<T> acquire);
    T Get<T>(string key, Func<T> acquire, int cacheTime);
    Task<T> GetAsync<T>(string key, Func<Task<T>> acquire);
    Task<T> GetAsync<T>(string key, Func<Task<T>> acquire, int cacheTime);
    Task<T> SetAsync<T>(string key, Func<Task<T>> acquire);
    Task<T> SetAsync<T>(string key, Func<Task<T>> acquire, int cacheTime);
    Task RemoveAsync(string key, bool publisher = true);
    Task RemoveByPrefix(string prefix, bool publisher = true);
    Task Clear(bool publisher = true);
}