What Changed
DataSourceLoadOptionsParser used Newtonsoft.Json
library to deserialize data processing settings. This functionality is now handled by the Microsoft System.Text.Json
library.
Previously:
- The
JsonProperty / DefaultValueHandling.Ignore
attribute fromNewtonsoft.Json
was used to decorate result classes from DevExtreme.AspNet.Data.ResponseModel. - It ignored default property values of classes from DevExtreme.AspNet.Data.ResponseModel.
- This only happened if serialization was executed by
Newtonsoft.Json
.
Now:
- The
JsonIgnore / JsonIgnoreCondition.WhenWritingDefault
attribute fromSystem.Text.Json
is used to ignore default property values of classes from from DevExtreme.AspNet.Data.ResponseModel. - This only takes effect if serialization is done by
System.Text.Json
.
Reasons for Change
- Microsoft designed
System.Text.Json
for security standard compliance (the RFC 8259 specification) and performance (both faster and lower memory allocation). - Microsoft uses
System.Text.Json
in many their products since the release of ASP.NET Core 3.0 and also recommends it as a long-term solution for .NET developers. For more information, please refer to Overview | Migrate from Newtonsoft.Json to System.Text.Json. - Microsoft supports System.Text.Json for .NET 6+ and .NET Framework 4.6.2+ apps. This support allows us to use this library across a wide range of DevExpress libraries/components.
Impact on Existing Apps
The population of DataSourceLoadOptionsBase.Filter (from serialized strings values) might behave differently due to how System.Text.Json
and Newtonsoft.Json
handle built-in .NET primitive types differently.
How to Update Existing Apps
Remove the Newtonsoft.Json
dependency from the project if it was added explicitly.