Created
August 30, 2021 15:42
-
-
Save mirmostafa/bd2215cab2daa4a4fb2ddcb4ad2c9a28 to your computer and use it in GitHub Desktop.
Constructor & Extension Deconstruct
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Person { | |
public Person (string first, string last) => (this.First, this.Last) = (first, last); | |
} | |
public static class Extensions { | |
public static void Deconstruct(this Person p, out string first, out string last) => (first, last) = (p.First, p.Last); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment