如何为文件系统实现 OData 服务

发布于 2024-11-09 12:27:51 字数 134 浏览 3 评论 0 原文

如果我想创建一个代表我的文件系统的 OData 服务,我该怎么做?

最简单的方法是获取文件系统的副本并保存在数据库中,然后在其之上创建 odata 服务。但如果有一种方法可以根据实际文件系统创建上下文,那就会更顺利。

啊?

If I want to create an OData service that represents my filesystem, how would I go about that ?

The easy way would be to take a copy of the filesystem and save in a database, and then create the odata service on top of that. But it would be much slicker if there was a way of creating a context based on the actual filesystem.

Huh ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

浅笑轻吟梦一曲 2024-11-16 12:27:51

You can implement a custom provider which can then do whatever you need in regard of getting the data from somewhere. Take a look at this series of how to implement a custom provider: http://blogs.msdn.com/b/alexj/archive/2010/01/07/data-service-providers-getting-started.aspx
There are also samples available at http://www.odata.org/developers/odata-sdk (OData Provider Toolkit).
The tricky part of exposing file system is to define the data model. For example, what would be your primary key for a file (note that it has to be unique for the entire service). It is definitely doable though.

秋日私语 2024-11-16 12:27:51

这是我最近发现的事情。 Codeplex 上的 @lostintangent 提供了一个工具包,称为 WCF 数据服务工具包。这将允许您以 OData 源的形式公开来自任何数据源的数据,但采用简约的方法。

看看这是否能以任何方式帮助你。显示的示例是 OData 服务,它实际上与 Instagram API 进行通信并提供数据。

以下是链接:

http://wcfdstoolkit.codeplex.com/

我的一位朋友在使用此工具包:
http://weblogs.asp.net/nmarun/archive/2011/05/23/wcf-data-services-toolkit-to-talk-to-any-database -using-getall-getone-save-remove-methods.aspx

希望对您有帮助。

This is something i found out recently. There is a tool kit available from @lostintangent on Codeplex known as WCF Data Services Toolkit. This will allow you to expose data from any data source as an OData feed but with minimalistic approach.

See if that can help you in any way. The examples shown is of a OData service which actually talks to instagram API and provides the data.

Here are the links:

http://wcfdstoolkit.codeplex.com/

One of my friend has a complete walkthro on using this toolkit:
http://weblogs.asp.net/nmarun/archive/2011/05/23/wcf-data-services-toolkit-to-talk-to-any-database-using-getall-getone-save-remove-methods.aspx

hope it helps you.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文