Where is the ExecuteStoreCommand method in Entity

2019-03-22 15:03发布

I'm using EF5 in VS2012, and I trying to delete all data of some table using ExecuteStoreCommand, something like this:

ctx.ExecuteStoreCommand("TRUNCATE TABLE [" + tableName + "]");

but the problem is EF is telling me, method ExecuteStoreCommand not found. I can't understand why?

Can you tell me why?, or give me a performant solution remove all data of the table.

1条回答
家丑人穷心不美
2楼-- · 2019-03-22 15:33

Try this:

ctx.Database.ExecuteSqlCommand
查看更多
登录 后发表回答