Updating multiple rows Linq vs SQL

后端 未结 5 618
生来不讨喜
生来不讨喜 2021-01-01 17:06

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 D         


        
5条回答
  •  囚心锁ツ
    2021-01-01 17:41

    PLINQO has implemented the batch updates and deletes and each entity generated by plinqo can use the batch update and delete operations.

    context.Task.Update(t => t.Id == 1, t2 => new Task {StatusId = 2});
    

    This will perform an Update Task Set StatusId = 2 Where Id = 1

提交回复
热议问题