title: Get keys for maximum value from dictionary
body: <p>I have a Dictionary of type</p>
  
  <pre><code>Dictionary&lt;int, GValue&gt; 
  </code></pre>
  
  <p>where GValue is an object that contains two double values P1 and P2</p>
  
  <p>I am trying to get key for maximum values from dictinary using follwing code</p>
  
  <pre><code>var keyForMaxP1 = dict.Keys.Aggregate((i, j) =&gt; dict[i].P1 &gt;= dict[j].P1 ? i : j);
  var keyForMaxP2 = dict.Keys.Aggregate((i, j) =&gt; dict[i].P2 &gt;= dict[j].P2 ? i : j);
  </code></pre>
  
  <p>It gives me keys for max P1 and P2 Correctly.</p>
  
  <p>But what if dictinary contains more than one key with max P1 Or P2 Value ??
  Here it still returning one Key which comes first during traversing of dictinary.</p>
  
  <p><strong>Edit</strong></p>
  
  <p>Suppose dictionary have values P1 with max value say 3.52. Now if there are two entries in dictionary with value P1  = 3.52, I wanna to get both the keys related to this value </p>