I have an action method which returns a DataRow object. Unfortunately the webapi serializer doesn't serialize the object properly. Is there any place where I can place a custom serialization code just for this particular type ?
You'll probably want to create a custom MediaTypeFormatter that returns true for DataRow-typed objects in its CanWrite method.
Here's a good starting point for how to write and register your own formatter:
http://www.asp.net/web-api/overview/formats-and-model-binding/media-formatters
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With