Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Edited Issue: Global Json serializer settings aren't used when posting to server [609]

$
0
0
And the culprit is TryReadQueryAs method of UriExtensions that just instantiates a new JsonSerializer that doesn't use global serializer settings, defined in config.Formatters.JsonFormatter.SerializerSettings. One of the consequences of this, is that I can't bind derived classes to base classes, using JSON.NET TypeNameHandling. Please fix this ASAP.<br /><br />For example: <br />I serialize an Employee, and since i set TypeNameHandling to auto, it will add $type="Employee" to the serialized json. Then when I send that json back to some method that expects class Person, it will bind it to person (Employee properties will not get bound) and will ignore the type, because the said method doesn't use global settings(where I set TypeNameHandling). And hence uses TypeNameHandling.None.

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>