Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In the event that you need them to have feature-parity with .Net 4.0 (primarily comparisson):</p> <pre><code>static class Tuple { public static Tuple&lt;T1, T2&gt; Create&lt;T1, T2&gt;(T1 item1, T2 item2) { return new Tuple&lt;T1, T2&gt;(item1, item2); } } [DebuggerDisplay("Item1={Item1};Item2={Item2}")] class Tuple&lt;T1, T2&gt; : IFormattable { public T1 Item1 { get; private set; } public T2 Item2 { get; private set; } public Tuple(T1 item1, T2 item2) { Item1 = item1; Item2 = item2; } #region Optional - If you need to use in dictionaries or check equality private static readonly IEqualityComparer&lt;T1&gt; Item1Comparer = EqualityComparer&lt;T1&gt;.Default; private static readonly IEqualityComparer&lt;T2&gt; Item2Comparer = EqualityComparer&lt;T2&gt;.Default; public override int GetHashCode() { var hc = 0; if (!object.ReferenceEquals(Item1, null)) hc = Item1Comparer.GetHashCode(Item1); if (!object.ReferenceEquals(Item2, null)) hc = (hc &lt;&lt; 3) ^ Item2Comparer.GetHashCode(Item2); return hc; } public override bool Equals(object obj) { var other = obj as Tuple&lt;T1, T2&gt;; if (object.ReferenceEquals(other, null)) return false; else return Item1Comparer.Equals(Item1, other.Item1) &amp;&amp; Item2Comparer.Equals(Item2, other.Item2); } #endregion #region Optional - If you need to do string-based formatting public override string ToString() { return ToString(null, CultureInfo.CurrentCulture); } public string ToString(string format, IFormatProvider formatProvider) { return string.Format(formatProvider, format ?? "{0},{1}", Item1, Item2); } #endregion } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload