c# - 调试时如何评估延迟的 Linq 语句?

标签 c# linq debugging visual-studio-2010 deferred-execution

我在 VS2010 中调试,我想检查一个字符串值,但我只能让调试器向我展示(通过监视、悬停、局部变量等)是:

"System.Linq.Enumerable+<TakeIterator>d__3a`1[System.Char]"

我不关心过早求值是否有副作用,我只是想看看如果我现在在当前断点处求值,表达式会求值什么。

这是怎么做到的?我还可以以更早评估的方式更改我的代码吗?不是说我不在调试时关心...只是想知道。

In case it is relevant... (I doubt it.) I'm stuffing a new entity object before saving it to the database... some fields are assigned with LINQ statements, I'm not sure when they get evaluated under the covers of EF. The DB update fails with 'string or binary data would be truncated... So I'm trying to find the too-long field.

最佳答案

Screenshot


你是不是不小心做了这样的事情?

Screenshot

关于c# - 调试时如何评估延迟的 Linq 语句?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2702390/

相关文章:

c# - 我应该如何覆盖 DbContext 上的 SaveChanges() 方法,以便使用 EF 4.3 维护已删除/修改的记录?

c# - 向项目添加右键单击菜单

c# - 在 For 循环中使用 DateTime,递增日期不起作用

c# - 在 Reactive Extensions 中如何将项目缓冲到组中?

c - 使用 GDB 打印/观察大型代码库文件中的变量?

c++ - 选择用于 CUDA 调试的设备

c# - 为什么我的 SignalR 应用有时会断开连接

c# - 如何使用 LINQ 选择一个对象?

Linq to SQL 的 C# XML 文档

c++ - Mac C++/Mars eclipse gdb 调试在启动测试 96% 时挂起