FalconSSO/FAuth/Extensions/ICacheProvider.cs

28 lines
911 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
namespace FAuth.Extensions
{
/// <summary>
/// 数据缓冲提供器接口
/// </summary>
public interface ICacheProvider
{
/// <summary>
/// 设置缓存数据
/// </summary>
/// <typeparam name="T">数据类型</typeparam>
/// <param name="key">数据键</param>
/// <param name="obj">数据对象</param>
/// <param name="span">缓存时间或者从CacheTimeSpan选择值</param>
void SetCache<T>(string key,T obj,TimeSpan span) where T : class;
/// <summary>
/// 从缓存中获取数据如果未缓存返回null
/// </summary>
/// <typeparam name="T">数据类型</typeparam>
/// <param name="key">缓存数据的键</param>
/// <returns>数据对象</returns>
T GetObj<T>(string key) where T : class, new();
}
}