0
我实现在Windows Azure项目表存储。我的代码:这里单()方法不支持
/// //// Method of _Table class
public CloudTableQuery<Html> AccessEntites()
{
CloudTableQuery<Html> entries =
(from e in ServiceContext.CreateQuery<Html>(TableName)
select e).AsTableServiceQuery();
return entries;
}
/// //
/// Controller code
private _Table db = new _Table("table-name");
public ViewResult Details(string id)
{
Html htmlfile = db.AccessEntites().Single(h => h.RowKey == id); <=========
return View(htmlfile);
}
//////
问题是,我收到异常Single method not supported
。有人可以告诉我为什么吗?
'使用System.Linq'任何机会? – 2012-07-23 14:04:31
这是什么'_Table'什么'db.AccessEntites()'回报? – 2012-07-23 14:05:28
'Linq'和'sql'不完全相同。并非所有可以使用'ling'描述的内容都可以自动转换为'sql'。当你做一些电脑无法翻译的东西时,你会得到这个信息。 (您也可以替换'sql'的任何数据提供程序试图用'Linq'访问。) – Servy 2012-07-23 14:05:56