


The problem with creating a copy of a value object is that the two copies can have separate changes made to them - what started off as two identical objects drift apart. Structs (and other value types) work that way when compared, but with structs, assigning a value from one struct to another copies the data (it's different with classes: assigning one variable to another just copies pointers around and both variables end up pointing to the same object in memory rather than getting their own copies of the data). even if they're from two different customers and one is a "Shipping" address while the other is a "Billing" address. An address is a good example of a value object: two addresses are the same if they have identical city/street/etc.

One of the key concepts of that approach are what are called value objects: objects that are considered identical because they have the same values in their properties, not because they share a primary key or location in memory. NET 5, though, and here are my favorite new features. The new version of C# 9 is more than just a nice feature of. NET 5 (I might make that claim about C# 8 and. I won't say that, all by itself, C# 9 is worth the migration to.
