Skip to content

Instantly share code, notes, and snippets.

@werwolfby
Forked from emoacht/KeyValuePairExtension.cs
Last active December 16, 2017 10:17
Show Gist options
  • Save werwolfby/b836ba09543f3554fe96dd9e10728a16 to your computer and use it in GitHub Desktop.
Save werwolfby/b836ba09543f3554fe96dd9e10728a16 to your computer and use it in GitHub Desktop.
Deconstruct extension method for KeyValuePair in C# 7
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