Skip to content

Instantly share code, notes, and snippets.

@VladoMS
Forked from emoacht/KeyValuePairExtension.cs
Created August 18, 2017 19:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VladoMS/718b83a0a619a4abe293119ccb11a9aa to your computer and use it in GitHub Desktop.
Save VladoMS/718b83a0a619a4abe293119ccb11a9aa 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