Episode

Ignoring Properties when reading & writing JSON

with James Montemagno, Matt Soucoup

When serializing C# objects to JavaScript Object Notation (JSON), by default, all public properties are serialized. If you don't want some of them to appear in the resulting JSON, you have several options. In this video, James and Matt show you all of the built in options you can use to control this.

Chapters

  • 00:00 - What are extra JSON properties
  • 01:30 - Ignoring a single property with JsonIgnore
  • 04:00 - Ignoring read only fields and properties
  • 05:30 - Ignoring default and null values
  • 09:08 - JsonIgnore Conditions
  • 12:40 - Always ignore everything
  • 14:00 - Wrap-up

Developer
.NET