title: Alternative to setting values in foreach C#
body: <p>I'm rather new to MVC/C# and from what I understand, foreach is read-only.</p>
  
  <p>I would like there to be a method that sets the values that are null to false <em>if</em> that method is called.</p>
  
  <pre><code>IQueryable&lt;CurrentMatch&gt; FindTheMatch = (from row in db.CurrentMatches
                                                   where row.UserId.ToString() == UserIdentity
                                                   where row.MatchID == MatchIdentity
                                                   select row);
  
          List&lt;CurrentMatch&gt; SetRemainingValuesToFalse = FindTheMatch.ToList();
  </code></pre>
  
  <p>I know that the part below wont work, it just demonstrates how I'm trying to achieve what I want to do.</p>
  
  <pre><code>        foreach (var Column in SetRemainingValuesToFalse)
          {
              if (Column == null)
              {
                  Column = false;
              }
          }
  </code></pre>
  
  <p>As the row has a large number of properties it wouldn't be scaleable in the future to set each property manually.</p>