0

I'm using NewtonSoft Json.Net to serialize my objects to JSON. On of my classes is not serializing correctly. I was wondering if it is possible to build a custom type serializer that will output different JSON.

How can I make a custom serializer/deserializer for a specific class?

2
  • 1
    If you can provide more details about your class and what the JSON needs to look like, I'd be happy to provide a specific example. Otherwise, you can look at this answer, which demonstrates how to get around problems when serializing/deserializing the IPAddress and IPEndpoint classes. That may be enough to get you started. Commented Nov 22, 2013 at 15:33
  • @BrianRogers, thanks, but the answer of Dmytro helped me out. Commented Nov 22, 2013 at 15:47

1 Answer 1

1

you may create your own Custom JsonConverter and implement its ReadJson and WriteJson methods.

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

Comments

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.