FalconSSO/FAuth/Extensions/IJsonProvider.cs

24 lines
682 B
C#
Raw Normal View History

2020-03-30 10:12:52 +08:00
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);
}
}