Sign in to confirm you’re not a bot
This helps protect our community. Learn more
Ignoring Properties when reading & writing JSON
108Likes
4,492Views
2024Jan 17
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. Full Playlist:    • JSON Serialization with System.Text.Json   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 Resources: Docs: https://learn.microsoft.com/dotnet/st... Connect with .NET: Blog: https://aka.ms/dotnet/blog Twitter: https://aka.ms/dotnet/twitter TikTok: https://aka.ms/dotnet/tiktok Mastodon: https://aka.ms/dotnet/mastodon LinkedIn: https://aka.ms/dotnet/linkedin Facebook: https://aka.ms/dotnet/facebook Docs: https://learn.microsoft.com/dotnet Forums: https://aka.ms/dotnet/forums 🙋‍♀️Q&A: https://aka.ms/dotnet-qa 👨‍🎓Microsoft Learn: https://aka.ms/learndotnet #dotnet #systemtextjson #json

Follow along using the transcript.

dotnet

325K subscribers