CodeGym
AI Academy
Promotion
CodeGym University
Learning
Courses
Tasks
Surveys & Quizzes
Games
Help
Schedule
Community
Users
Forum
Chat
Articles
Success stories
Activity
Reviews
Subscriptions
Light theme

Lessons

  • Reviews
  • About us
Start
Start learning
Start learning now
  • My Progress
  • Courses
  • University
  • Quest Map
  • Lessons
  • Serialization of simple collections: List<T>, T[]

    C# SELF
    Level 46, Lesson 0
    Let's go through how to serialize and deserialize arrays T[] and lists List<T> using System.Text.Json: how collections in C# map to JSON arrays, how to save data to a file and read it back, what to watch out for with null, empty collections and polymorphism. Everything with clear examples using files and serializer settings.
    Available
  • Dictionary serialization

    C# SELF
    Level 46, Lesson 1
    How to serialize and deserialize dictionaries to JSON using System.Text.Json: from simple cases with string keys to numeric and nested objects. We'll go over why complex objects can't be used as keys, how JsonSerializerOptions options (for example, PropertyNamingPolicy) affect things, and when it's better to replace a dictionary with a list of pairs. With practical examples, JSON snippets, and a breakdown of pitfalls.
    Available
  • Serialization of nested and hierarchical objects

    C# SELF
    Level 46, Lesson 2
    In this lecture we go through how to serialize and deserialize multi-level structures in C# using System.Text.Json: trees, graphs with potential cycles, nested collections and attributes. We'll discuss JsonSerializer, the ReferenceHandler. IgnoreCycles option, the JsonIgnore attribute, storing references via identifiers and practical patterns for real apps (catalogs, employees, authors/books).
    Available
  • The problem of cyclic references

    C# SELF
    Level 46, Lesson 3
    In this lecture we look at what cyclic references are and why they break serialization: by default System.Text.Json throws a JsonException when it detects cycles. We'll go over practical approaches: clearing references, the [JsonIgnore] attribute, switching to identifiers instead of nested objects, and enabling reference serialization via ReferenceHandler. Preserve. We'll also compare with Newtonsoft.Json capabilities and give practical recommendations for REST APIs.
    Available
  • Controlling serialization of collections

    C# SELF
    Level 46, Lesson 4
    How to hide collections and their fields from serialization, rename properties to match an API contract, manage null values and output formats in System.Text.Json. We'll go through attributes like [JsonIgnore], [JsonPropertyName], options JsonSerializerOptions, working with dictionaries, common pitfalls and practical interview questions.
    Available
Learn
  • Registration
  • Java Course
  • Help with Tasks
  • Pricing
  • Java Syntax
Community
  • Users
  • Articles
  • Forum
  • Chat
  • Success Stories
  • Activity
  • Affiliate Program
Company
  • About us
  • Contacts
  • Reviews
  • Press Room
  • CodeGym for EDU
  • FAQ
  • Support
CodeGym CodeGym is an online course for learning Java programming from scratch. This course is a perfect way to master Java for beginners. It contains 1200+ tasks with instant verification and an essential scope of Java fundamentals theory. To help you succeed in education, we’ve implemented a set of motivational features: quizzes, coding projects, content about efficient learning, and a Java developer’s career.
Follow us
Interface language
English
Deutsch Español हिन्दी Français Português Polski বাংলা 简体中文 मराठी தமிழ் Italiano Bahasa Indonesia 繁體中文 Nederlands 日本語 한국어 Bulgarian Danish Hungarian Basa Jawa Malay Norwegian Romanian Swedish Telugu Thai Українська Filipino Turkish Azərbaycan Русский Vietnamese
Programmers Are Made, Not Born © 2026 CodeGym
MastercardVisa
Programmers Are Made, Not Born © 2026 CodeGym