C# – How to deconstruct an object
Deconstructing an object means assigning its properties to several variables with a one-liner using deconstruction assignment syntax (also referred to as destructuring or unpacking). Here’s an example of deconstructing an object: This outputs the following: Several built-in types already support deconstruction – such as tuples, dictionary (KeyValuePair), and records. You can enable deconstruction for any … Read more