哪里是在实体框架5 ExecuteStoreCommand方法? [英] Where is the ExecuteStoreCommand method in Entity Framework 5?

查看:220
本文介绍了哪里是在实体框架5 ExecuteStoreCommand方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用EF5在VS2012,我想删除使用 ExecuteStoreCommand 部分表的所有数据,
是这样的:

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 + "]");



但问题是EF告诉我,方法ExecuteStoreCommand没有找到。我不明白为什么?

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.

推荐答案

试试这个:

ctx.Database.ExecuteSqlCommand

这篇关于哪里是在实体框架5 ExecuteStoreCommand方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆