-2

Is there built-in .NET support for building JSON messages (with escaping)? I can't use external libraries like JSON.NET because of binary size.

Thanks!

Edit: I was hoping to just have a message constructor without the constraint of creating a strict datatype, but I guess it's good enough.

Edit2: Actually it's not good enough. I'm looking to write JSON messages that don't correspond in a naive 1:1 way to a data structure, but it looks like I just have to write my own escaping, a la this answer

Community
  • 1
  • 1
bfops
  • 4,878
  • 4
  • 31
  • 43

2 Answers2

0

You could use the DataContractJsonSerializer.

Jeroen Kok
  • 726
  • 4
  • 6
-1

Check DataContractJsonSerializer Class

Saurabh R S
  • 2,937
  • 1
  • 30
  • 42