Nondestructive Mutation and Records in C#

preview_player
Показать описание

One of the prominent features of C# record types, which were introduced in C# 9, is nondestructive mutation and with expressions. In this video, we will investigate the with expression syntax, as well as a couple of options that exist to install nondestructive mutation into a custom class which is not a record.

Learn more from video courses:

Other videos on this channel you may be interested in watching:
Рекомендации по теме
Комментарии
Автор

Syntax is very tempting, but I would be cautious in using records to model domain objects.
What do you think about encapsulation of such solution and about protecting the invariants?

LM-kdjx