24 lines
682 B
C#
24 lines
682 B
C#
namespace FAuth.Extensions
|
|
{
|
|
/// <summary>
|
|
/// Json序列化接口
|
|
/// </summary>
|
|
public interface IJsonProvider
|
|
{
|
|
/// <summary>
|
|
/// 获取Json字符串
|
|
/// </summary>
|
|
/// <typeparam name="T">对象类型</typeparam>
|
|
/// <param name="obj">要序列化的对象</param>
|
|
/// <returns>Json串</returns>
|
|
string GetJson<T>(T obj);
|
|
/// <summary>
|
|
/// 获取对象
|
|
/// </summary>
|
|
/// <typeparam name="T">对象类型</typeparam>
|
|
/// <param name="json">Json串</param>
|
|
/// <returns>对象</returns>
|
|
T GetObj<T>(string json);
|
|
}
|
|
}
|