哪里是EntitySet的< T>的"结果查看"? [英] Where is EntitySet<T>'s "Results View"?
问题描述
在寻找一个链接的EntitySet< T>
A LINQ到SQL映射的实体,我看到以下内容:
我想看到下面这样我就可以点击小刷新图标,看到的内容(通过使用 .AsQueryable()
扩展方法实现):
为什么我不能看到结果查看定期平原的EntitySet< T>
此外,我注意到,在这个MSDN页面它说:
在LINQ到SQL中,
的EntitySet< TEntity>
类实现了IQueryable的
接口
块引用>
这是我所看到的,
的EntitySet< TEntity>
不从任何的IQueryable
也不的IQueryable<继承; T>
。 ?那么什么是有这种说法。
解决方案您会找到这个问题的答案的问题
结果只能查看适用于符合以下
条件
的集合- 实现IEnumerable或IEnumerable的(VB.Net只适用于
的IEnumerable)
- 请不可以实现IList,IList的,ICollection的或
ICollection的(C#限制只)
- 请不会有DebuggerTypeProxy属性
- System.Core.dll在加载在调试进程
块引用>
在特定的#2,EntitySet的< T>实施的IList的< T>因此,调试器不会显示结果视图选项。
使用AsQueryable已扩展方法返回一个对象,只有实现了IQueryable的和IEnumerable,因此将显示结果查看选项。
您可以阅读更多关于其他问题给出了答案#2。
When looking at a linked
EntitySet<T>
of a LINQ to SQL mapped entity, I see the following:I'd like to see the following (achieved by using the
.AsQueryable()
extension method) so that I can click the little refresh icon and see the content:Why can't I see the Results View on a regular plain
EntitySet<T>
?Also, I've noticed that on this MSDN page it says:
In LINQ to SQL, the
EntitySet<TEntity>
class implements theIQueryable
interface.From what I can see,
EntitySet<TEntity>
doesn't inherit from eitherIQueryable
norIQueryable<T>
. So what's up with that claim?解决方案You'll find the answer to this question
The results view only works for collections which meet the following conditions
- Implement IEnumerable or IEnumerable (VB.Net only works for IEnumerable)
- Do not implement IList, IList, ICollection or ICollection (C# restriction only)
- Do not have a DebuggerTypeProxy attribute
- System.Core.dll is loaded in the debugee process
In particular #2, EntitySet<T> implement's IList<T> therefore the debugger won't show a "Results View" option.
Using the AsQueryable extension method returns an object which only implements IQueryable and IEnumerable and therefore will show the "Results View" option.
You can read more about the #2 in the answer given in the other question.
这篇关于哪里是EntitySet的< T>的"结果查看"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!