For example I have table like this
Table
ID -- CategotyID -- ProductName
1 --------- 4 ----------Coca-Cola
2 --------- 7 ----------Tea
3 --------- 4 ----------Sprite
When I write in entityframework this code:
var list= db.Table.Where(w => w.CategotyID == 4).ToList();
list.ForEach(update => update.ProductName = "Fanta");
db.SaveChanges()
I saw in SQL Profiler executes this statement separately like thisupdate Table set ProductName = "Fanta" where ID = 1
update Table set ProductName = "Fanta" where ID = 3
How can I write from SQL to EntityFrameWork this statement?update Table set ProductName = "Fanta" where CategoryID = 4
Don't wont to SQL Server executes it separately