title: Updating multiple rows Linq vs SQL
body: <p>Some time ago I wrote a piece of code to update multiple rows in a database table. The code was like this</p>
  
  <pre><code>var db = new MyDataContext();
  db.Execute("UPDATE Details SET IsActive = 0 WHERE MasterId = 1");
  </code></pre>
  
  <p>Then the other day when I got the latest version of the file I saw that somebody changed the code to something like this</p>
  
  <pre><code>var details = from d in db.details where d.MasterId == 1 select d;
  foreach (var detail in details)
    detail.IsActive = false;
  db.SubmitChanges();
  </code></pre>
  
  <p>So my question is: What is the better way to update multiple rows? Using Linq or SQL?</p>