我正在从.NET Core 3.0 应用程序迁移Newtonsoft.Json到System.Text.Json。我试图忽略错误值。
在System.Text.Json我找到了忽略空值的选项:
JsonSerializerOptions.IgnoreNullValues = true;
Run Code Online (Sandbox Code Playgroud)
但是我找不到忽略System.Text.Json.
有人知道如何做到这一点System.Text.Json吗?
或者,如果有人知道相当于 Newtonsoft 的DefaultValueHandling = DefaultValueHandling.Ignore选项,那也太棒了。