C# Model TO JSON

NuGet安装转json包

using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

IsoDateTimeConverter timeFormat = new IsoDateTimeConverter();
var b = JsonConvert.SerializeObject( 实体类构造的对象 , Newtonsoft.Json.Formatting.Indented, timeFormat);
原文地址:https://www.cnblogs.com/tangpeng97/p/7911852.html