【发布时间】:2014-08-12 08:52:45
【问题描述】:
我有一个 LINQ 查询,想要像这样选择我的实体类型:
static void Main(string[] args)
{
using (var currentContext = new MyContext())
{
var x = (from c in currentContext.GeneralAccounts
select new { CType = c.GetType() }).ToList();
}
}
但是这个查询出错了:
错误:LINQ to Entities 无法识别方法“System.Type GetType()”方法,并且该方法无法转换为存储表达式。
【问题讨论】:
标签: c# linq entity-framework linq-to-sql linq-to-entities