Ai
1 Star 1 Fork 0

Auser/HttpClientLite

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
ObjectJsonHelper.cs 781 Bytes
Copy Edit Raw Blame History
Auser authored 2025-04-28 13:34 +08:00 . no commit message
using Newtonsoft.Json;
namespace HttpClientLite.Extensions;
/// <summary>
/// 对象json帮助工具
/// </summary>
internal static class ObjectJsonHelper
{
/// <summary>
/// 反序列化
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="json"></param>
/// <returns></returns>
internal static T Deserialize<T>(string json) where T : class
=> JsonConvert.DeserializeObject<T>(json, JsonSettings.SerializerSettings)!;
/// <summary>
/// 序列化
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="self"></param>
/// <returns></returns>
internal static string Serialize<T>(T self) where T : class
=> JsonConvert.SerializeObject(self, JsonSettings.SerializerSettings);
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/Ausername/HttpClientLite.git
git@gitee.com:Ausername/HttpClientLite.git
Ausername
HttpClientLite
HttpClientLite
master

Search