title: What's the best way to set all values in a C# Dictionary<string,bool>?
body: <p>What's the best way to set all values in a C# Dictionary?</p>
  
  <p>Here is what I am doing now, but I'm sure there is a better/cleaner way to do this:</p>
  
  <pre><code>Dictionary&lt;string,bool&gt; dict = GetDictionary();
  var keys = dict.Keys.ToList();
  for (int i = 0; i &lt; keys.Count; i++)
  {
      dict[keys[i]] = false;
  }
  </code></pre>
  
  <p>I have tried some other ways with foreach, but I had errors.</p>