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