-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
  • 5,348
  • 5
  • 36
  • 48

2 Answers2

0

You could use the DataContractJsonSerializer.

Jeroen Kok
  • 796
  • 5
  • 7
-1

Check DataContractJsonSerializer Class

Saurabh R S
  • 3,037
  • 1
  • 34
  • 44