Ext.NET icon indicating copy to clipboard operation
Ext.NET copied to clipboard

Allow specifying JsonSerializerSettings to direct methods

Open fabriciomurta opened this issue 5 years ago • 0 comments

Found: 5.3.0 Ext.NET forum thread: Problem with JSON serialization in direct method

One way to use custom Newtonsoft.Json serializer settings during an individual Ext.NET request is by setting JSON.RequestSettings to the desired instance of Newtonsoft.Json.JsonSerializerSettings. The problem though lies if the parameters provided to the direct method require the specific serialization settings to be in effect while they are parsed. As the method has still not run at the time its parameters are extracted from the AJAX submission data, the custom JSON settings simply couldn't be specified at that time.

The arguments are only parsed once the Direct Method is selected from the submission headers, thus it should be possible to, instead, pass the custom configuration instance as an attribute (or parameter of the DirectMethod attribute) decorating the direct method, so the RequestSettings are applied during parameter serialization.

fabriciomurta avatar Nov 13 '20 17:11 fabriciomurta