DataServiceConfiguration 是内部的,因此我无法启用 WCF 数据分页?
我的 WCF 数据服务出现问题,而这个问题实在是太奇怪了。我正在尝试启用分页,以便更好地处理大型集合,这是我最初使用数据服务的整个想法。
但是,我看到的所有示例都是基于使用 DataServiceConfiguration
,如下所示:http://blogs.msdn.com/astoriateam/archive/2010/02/02/server-paging-in-data-services。 aspx,此处:http://msdn.microsoft.com/en-http://msdn.microsoft.com/en-us/library/system.data.services.dataserviceconfiguration.aspx 。
现在出现了奇怪的情况 - 当我尝试访问它时,这个类不存在(我的服务是使用 IDataServiceConfiguration 设置的,该接口和类本身没有出现在智能感知中,也没有出现)它变绿还是有红色“解决”智能标记),并且我引用了 System.Data.Services。
现在,如果我尝试构建,它会告诉我它已降至保护级别,所以我去寻找。使用 Reflector 我找到了该类,标记为内部...那么这里发生了什么?我正在使用 VS 2008 SP1,我的项目是针对 .NET 3.5 SP1 构建的。
这很重要的原因是因为控制页面大小的属性是在类而不是接口上定义的
任何帮助都将不胜感激。
谢谢
I have a problem with my WCF Data Service, and this one is just plain weird. I'm trying to enable paging so that large collections will be handled better, which was the whole idea behind me using data services in the first place.
However, all the examples I've seen are based on using DataServiceConfiguration
, as shown here: http://blogs.msdn.com/astoriateam/archive/2010/02/02/server-paging-in-data-services.aspx, and here: http://msdn.microsoft.com/en-http://msdn.microsoft.com/en-us/library/system.data.services.dataserviceconfiguration.aspx.
Now comes the weird bit - this class isn't there when I try to access it (my service was set up using IDataServiceConfiguration
, the interface, and the class itself doesn't appear in the intellisense, nor does it go green or have the red "resolve" smart tag), and I have System.Data.Services referenced.
Now, if I try building, it tells me that it's down to the protection levels, so I went hunting. Using Reflector I found the class, marked internal... So what's happening here? I'm using VS 2008 SP1 and my project is building against .NET 3.5 SP1.
The reason this is important is because the properties that control page size are defined on the class not the interface
Any help at all would be greatly appreciated.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
啊,我一定是瞎了。
我读到有一个更新提供了此功能,但我假设它位于当前的下载包中,或者通过自动更新提供。并非如此 - 我需要下载此软件包:
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=4b710b89-8576-46cf-a4bf-331a9306d555#filelist
一旦我安装了它,班级神奇地出现了。
希望对某人有帮助。
谢谢
Ah, I must be blind.
I'd read that there was an update that gave this, but I'd assumed it was in the current download package, or would have been shipped by automatic update. Not so - I needed to download this package:
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=4b710b89-8576-46cf-a4bf-331a9306d555#filelist
Once I've installed that, the class magically appears.
Hope that helps somebody.
Thanks