2 posts about Immutable types by 2 contributors.
Know Immutable types? Share what you know with developers who are learning it.
Records in C# provide immutable data structures for representing data. They offer concise syntax for declaring classes with value-based equality, read-only members, and built-in methods like ToString(). Records support inheritance, pattern matching, and serialization, enhancing data modeling and manipulation in C# 9.
C# 9.0 introduced a new feature called Init-Only Properties, enhancing the language's capabilities for defining immutable types. Init-only properties allow you to create read-only properties that can only be set during object initialization. This feature simplifies the creation of immutable objects, providing a concise and expressive syntax for initializing properties at the time of object creation and ensuring their immutability afterwards.
DevSocialUpcoming · 3rd editionAI Agents ConferenceNov 23–27, 2026Live onlineMembers only16days leftRegisterPublish an article in this category and earn +1,000 SHARP when it is approved.
Write an article