score:3

Accepted answer

You are correct, running db.Items.Single(...) multiple times may be suboptimal.

Calling it once and then referencing its properties should be more efficient:

var item = db.Items.Single(t => t.Id == itemId);
item.TotalValue = 999;
item.CurrentValue = 99;
db.SaveChanges();

Related Articles