title: Assign value into Dictionary that has a key type of <Tuple<int,int> C#
body: <p>I writing code to generate a grid that is supposed to be a graphical editor. The grid values are being contained in a dictionary. This is my method for generating my dictionary object to give you an idea of what I am working with.</p>
  
  <pre><code>public Dictionary&lt;Tuple&lt;int, int&gt;, string&gt; GenerateTable(int _x, int _y)
          {
              int total = _x * _y;
              var grid = new Dictionary&lt;Tuple&lt;int, int&gt;, string&gt;(); //!Might need this later!
  
              for (int i = 1; i &lt;= _x; i++) // outer loop is column 
              {
                  for (int ii = 1; ii &lt;= _y; ii++) // Inner loop is row -
                  {
                      grid.Add(Tuple.Create(i, ii), "O");
                  }
              }
              return grid; // Should have same amount of elements as int total
          }
  </code></pre>
  
  <p>I have another method where I want to change one element in my dictionary, because I am using a key of Tuple I don't know what to provide in the index to change the value. This is the other method.</p>
  
  <pre><code> public void ColorPixel(Dictionary&lt;Tuple&lt;int, int&gt;, string&gt; _table, int _x, int _y, string _c)
          {
              foreach(var pixel in _table
                  .Where(k =&gt; k.Key.Item1 == _x &amp;&amp; k.Key.Item2 == _y))
              {
  
              }
  
  
              //var tbl = _table.
              //    Where(t =&gt; t.Key.Item1 == _x &amp;&amp; t.Key.Item2 == _y)
              //    .Select(t =&gt; t.Value == _c);
  
          }
  </code></pre>
  
  <p>Does anyone know how I change the element in the dictionary by accessing it's key of type Tuple ?</p>