Skip to content

Instantly share code, notes, and snippets.

@mirmostafa
Created August 30, 2021 15:42
Show Gist options
  • Save mirmostafa/bd2215cab2daa4a4fb2ddcb4ad2c9a28 to your computer and use it in GitHub Desktop.
Save mirmostafa/bd2215cab2daa4a4fb2ddcb4ad2c9a28 to your computer and use it in GitHub Desktop.
Constructor & Extension Deconstruct
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