在转换为UTC时大于DataTime.MaxValue
问题补充:
方法如下:
public static string SerializedModel<T>(string jsonName, IList<T> IL)
{
StringBuilder Json = new StringBuilder();
Json.Append("{" + jsonName + ":");
if (IL.Count > 0)
{
for (int i = 0; i < 1; i++)
{
//Json.Append("{");
var stream = new MemoryStream();
var serializer = new DataContractJsonSerializer(typeof(IList<T>));
serializer.WriteObject(stream, IL);
byte[] dataBytes = new byte[stream.Length];
stream.Position = 0;
stream.Read(dataBytes, 0, (int)stream.Length);
string dataString = Encoding.UTF8.GetString(dataBytes);
Json.Append(dataString);
//Json.Append("}");
//if (i < IL.Count - 1)
//{
// Json.Append(",");
//}
}
}
Json.Append("}");
return Json.ToString();
}
就在序列化时报错。