标签:使用 setting online serialize 一个 convert 方法 null .json
如果对当前序列化的实体全部生效的话使用如下:
var jSetting = new JsonSerializerSettings {NullValueHandling = NullValueHandling.Ignore}; var json = JsonConvert.SerializeObject(response, Formatting.Indented, jSetting);
如果只是对其中一个属性生效的话,使用下面的方法:
[JsonProperty(PropertyName="onLineFile",NullValueHandling=NullValueHandling.Ignore)]
public OnLineFileVo OnLineFile { get; set; } //
标签:使用 setting online serialize 一个 convert 方法 null .json
原文地址:http://www.cnblogs.com/sczmzx/p/7813715.html