[英]VS2015 Watch LINQ var Error: The function evaluation requires all threads to run
I have the simplest of LINQ queries; 我有最简单的LINQ查询; just testing out some database connections in my app:
只测试我的应用程序中的一些数据库连接:
public IHttpActionResult Get()
{
var a = from c in Context.AspNetUsers where c.Id == 1 select c;
return Ok();
}
When I break at the return and place a watch on 'a', then attempt to inspect the result, I get the error: 当我在返回时打破并将手表放在'a'上,然后尝试检查结果,我得到错误:
"The function evaluation requires all threads to run" “功能评估需要所有线程运行”
This only happens under VS2015 . 这只发生在VS2015下 。 If I run under VS2013, I am able to inspect the result as I would expect.
如果我在VS2013下运行,我能够按照我的预期检查结果。
When I query for a single result as in: 当我查询单个结果时,如:
public IHttpActionResult Get()
{
var a = (from c in Context.AspNetUsers where c.Id == 1 select c).FirstOrDefault();
return Ok();
}
Then I don't get the error, regardless of VS version. 然后我不会得到错误,无论VS版本。
Is there an option setting somewhere that I have missed, or is this some known issue in VS2015? 是否存在我错过的选项设置,或者这是VS2015中的一些已知问题?
"a" is essentially a query, or task - to invoke that query and get some data you need to call something that puts the data from that query in an object. “a”本质上是一个查询或任务 - 调用该查询并获取一些数据,这些数据需要调用将该查询中的数据放入对象的内容。 So ToArray() or ToList() or something like that.
所以ToArray()或ToList()或类似的东西。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.