You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
889 B
C#

using System;
namespace Admin.Core.Common
{
/// <summary>
/// 缓存接口
/// </summary>
public interface ICaching
{
/// <summary>
/// 使用键和值将某个缓存项插入缓存中,并指定基于时间的过期详细信息
/// </summary>
/// <param name="key"></param>
/// <param name="obj"></param>
/// <param name="seconds"></param>
void Set(string key, object obj, int seconds = 0);
/// <summary>
/// 取缓存项,如果不存在则返回空
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="key"></param>
/// <returns></returns>
T Get<T>(string key);
/// <summary>
/// 移除指定键的缓存项
/// </summary>
/// <param name="key"></param>
void Remove(string key);
}
}