如何实现 IDataServiceMetadataProvider 并告诉我的数据服务使用该自定义提供程序?
使用 IDataServiceMetadataProvider 实现 ADO.NET 数据服务的自定义提供程序,然后告诉数据服务使用该提供程序,没有明显的入口点。有人在这方面有运气吗?我尝试在我的数据源类上实现此接口,但没有命中任何断点。也没有(明显的)方法可以通过传递给 InitializeService
函数的数据服务的 DataServiceConfiguration
参数来设置提供程序。
任何帮助将不胜感激。谢谢!
There's no obvious entry point for implementing a custom provider for an ADO.NET Data Service using IDataServiceMetadataProvider
, and then telling a Data Service to use that provider. Has anyone had any luck in this area? I've tried implementing this interface on my Data Source class, but none of my breakpoints are hit. There is also no (obvious) way to set the provider from the Data Service's DataServiceConfiguration
parameter passed in to the InitializeService
function.
Any help would be appreciated. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我们正在考虑修改 RTM 接口的一些文档。
同时,为了让数据服务运行时获取 IDataServiceMetadataProvider 实现,您需要在数据服务类上实现 IServiceProvider 接口。
MSDN 上的 IServiceProvider
示例:
We are looking at revising some of the documentation for these interfaces for RTM.
In the meantime , to get the Data Services runtime to pick up your IDataServiceMetadataProvider implementation , you will need to implement the IServiceProvider interface on your Data Service class .
IServiceProvider on MSDN
Sample :
只是为了添加 Phani 回复,您需要确保从 GetService 调用返回 IDataServiceMetadataProvider 和 IDataServiceQueryProvider。对于其余接口,您可以选择从 GetService 返回它或在 DataSource 类上实现它。
希望这有帮助。
谢谢
普拉蒂克
Just to add to Phani reply, you need to make sure that you return both IDataServiceMetadataProvider and IDataServiceQueryProvider from the GetService call. For rest of the interfaces, you have a choice to return it from GetService or implement it on your DataSource class.
Hope this helps.
Thanks
Pratik