using System.Threading.Tasks;
using Abp.Dependency;

namespace YGNT.Infrastructure.AbpEntity
{
    public interface ICacheBase<TCacheItem, in TPrimaryKey> where TCacheItem : class
    {
        /// <summary>
        /// 获取缓存
        /// </summary>
        /// <returns></returns>
        Task<TCacheItem> GetCacheItemAsync(TPrimaryKey id);
        /// <summary>
        /// 获取缓存
        /// </summary>
        /// <returns></returns>
        TCacheItem GetCacheItem(TPrimaryKey id);
        /// <summary>
        /// 移除缓存
        /// </summary>
        /// <param name="id"></param>
        void Remove(TPrimaryKey id);
    }
}