当使用JSON时.Net在ASP.Net Core 2.2在序列化为JSON时,当属性值为null时,我可以忽略该属性:
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public DateTime? Created { get; set; }
But when using the new ASP.Net Core 3.0 built in JSON (System.Text.Json) I can’t find an equivalent attribute to ignore a property if its value is null.
I could only find JsonIgnore.
我错过什么了吗?