Entity Framework. Delete all rows in table

前端 未结 21 1961
一生所求
一生所求 2020-11-28 01:25

How I can quickly remove all rows in table using Entity Framework?

I am currently using:

var rows = from o in dataDb.Table
           select o;
forea         


        
21条回答
  •  独厮守ぢ
    2020-11-28 02:07

    Make sure when you are trying to delete parent all children will cascade on delete. Or children have nullable foreign key.

提交回复
热议问题