title: Updating Multiple records using Linq Lambda in C#
body: <p>I have a <code>ThresholdTable</code> table with two columns  <code>ID varchar(max)</code> and <code>Value varchar(max)</code> </p>
  
  <pre><code>ID |  Value
  ----------------
  1  |  0701224225
  2  |  0701224012
  </code></pre>
  
  <p>I want to update this to</p>
  
  <pre><code>ID |  Value
  ----------------
  1  |  105394
  2  |  105595
  </code></pre>
  
  <p>How I can achieve through C#, Linq, Lambda expression.</p>
  
  <p>I am doing this way,</p>
  
  <pre><code>private const string ThresholdValue1 = "1";
  
  private const string ThresholdValue2 = "2";
  
  var Setting = this.context.ThresholdTable.Where(p =&gt; p.ID.Equals(ThresholdValue1) || p.ID.Equals(ThresholdValue2));
  foreach (var s in Setting)
  {
      if (s.ID.Equals(ThresholdValue1))
      {
          s.Value = "105394";
      }
      else if (s.ID.Equals(ThresholdValue2))
      {
          s.Value = 105595;
      }
      this.context.SaveChanges();
  }
  </code></pre>
  
  <p>Please suggest me some better way.</p>