哪里是EntitySet的< T>的"结果查看"? [英] Where is EntitySet<T>'s "Results View"?

查看:153
本文介绍了哪里是EntitySet的< T>的"结果查看"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在寻找一个链接的EntitySet< T> A LINQ到SQL映射的实体,我看到以下内容:





我想看到下面这样我就可以点击小刷新图标,看到的内容(通过使用 .AsQueryable()扩展方法实现):





为什么我不能看到结果查看定期平原的EntitySet< T>



此外,我注意到,在这个MSDN页面它说:




在LINQ到SQL中,的EntitySet< TEntity> 类实现了 IQueryable的接口




这是我所看到的,的EntitySet< TEntity> 不从任何的IQueryable 也不的IQueryable<继承; T> 。 ?那么什么是有这种说法。


解决方案

您会找到这个问题的答案的问题




结果只能查看适用于符合以下
条件





    的集合
  1. 实现IEnumerable或IEnumerable的(VB.Net只适用于
    的IEnumerable)

  2. 不可以实现IList,IList的,ICollection的或
    ICollection的(C#限制只)

  3. 不会有DebuggerTypeProxy属性

  4. 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 the IQueryable interface.

From what I can see, EntitySet<TEntity> doesn't inherit from either IQueryable nor IQueryable<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

  1. Implement IEnumerable or IEnumerable (VB.Net only works for IEnumerable)
  2. Do not implement IList, IList, ICollection or ICollection (C# restriction only)
  3. Do not have a DebuggerTypeProxy attribute
  4. 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的&LT; T&GT;的&QUOT;结果查看&QUOT;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆