Created
March 10, 2017 11:10
-
-
Save emoacht/e15808a8c2ef36d9154e2ea3f4e49c78 to your computer and use it in GitHub Desktop.
Deconstruct extension method for KeyValuePair in C# 7
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
public static class KeyValuePairExtension | |
{ | |
public static void Deconstruct<TKey, TValue>(this KeyValuePair<TKey, TValue> source, out TKey Key, out TValue Value) | |
{ | |
Key = source.Key; | |
Value = source.Value; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment