7

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 ?

1 Answer 1

7

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

Sign up to request clarification or add additional context in comments.

1 Comment

Yeah, thats what I was looking for, thaks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.