title: Conversion between Tuple<T1,T2> and KeyValuePair<T1, T2>
body: <p>Is there any built in conversion or cast between <code>KeyValuePair&lt;T1, T2&gt;</code> and <code>Tuple&lt;T1, T2&gt;</code>?</p>
  
  <p>I know this would be a trivial extension method:</p>
  
  <pre><code>public static KeyValuePair&lt;T1, T2&gt; ToPair&lt;T1, T2&gt;(this Tuple&lt;T1, T2&gt; source)
  {
      return new KeyValuePair&lt;T1, T2&gt;(source.Item1, source.Item2);
  }
  
  public static Tuple&lt;T1, T2&gt; ToTuple&lt;T1, T2&gt;(this KeyValuePair&lt;T1, T2&gt; source)
  {
      return Tuple.Create(source.Key, source.Value);
  }
  </code></pre>
  
  <p>But since objects can be used for similar purposes (especially since <code>KeyValuePair&lt;&gt;</code> was often used in place of a 2 element <code>Tuple&lt;&gt;</code> until it's addition to C#4.0), I was wondering if such a converter was already built into the framework?</p>
  
  <p>Reason I ask is I am working with an older library (targeting .NET 3.5) that used <code>KeyValuePair&lt;&gt;</code> in many places that a Tuple might be more appropriate, and I want to use <code>Tuple&lt;&gt;</code> in the new code.  so I'm trying to figure out if I can just cast or convert the return <code>kvp</code> values from these methods to <code>Tuple</code> or if I need to define my own conversion (or change the older code).</p>