简体   繁体   English

ODATA或ASP.NET中的可插拔,可扩展和RESTFUL服务存储库

[英]Pluggable, Extendable and RESTFUL Service Repository in ODATA or ASP.NET

I am going to develop a service repository using ODATA. 我将使用ODATA开发服务存储库。 As a result, I can model those public method of those classes as Entity Type with these properties automatically by reflection 结果,我可以通过反射自动将这些类的那些公共方法建模为具有这些属性的Entity Type。

  • Id. ID。 GUID 图形用户界面
  • Output. 输出。 It should depend on the type of the method return 它应该取决于方法返回的类型
  • ... (Any other input parameters) ...(任何其他输入参数)

On the other hand, I will also expose these public methods as an Entity Set under the previous defined Entity Type. 另一方面,我还将这些公共方法公开为先前定义的“实体类型”下的“实体集”。 Finally, public user can invoke the expose services RESTFULLY by POSTing a JSON object to the specific the URI and retrieve OUTPUT from the return JSON object with the help of ODATA protocol 最后,公共用户可以通过将JSON对象发布到特定的URI来调用RESTFULLY公开服务,并借助ODATA协议从返回的JSON对象中检索OUTPUT

Unfortunately, either Array of Primary Object or Array of Complex Object are not supported in Entity Type definition. 不幸的是,实体类型定义不支持主对象数组或复杂对象数组。 As a result, I can't define a SMTP Send Entity Type which will have multiple TO (string[]) or CC (also string[]) How can I deal with this problem? 结果,我无法定义将具有多个TO(字符串[])或CC(也字符串[])的SMTP发送实体类型,该如何解决此问题?

I heard that Microsoft have announced ODATA V3.0 and ASP.NET Web API. 听说微软宣布了ODATA V3.0和ASP.NET Web API。 Do these new technology can help? 这些新技术有帮助吗? Or any other suggestion for implementation an extendable RESTFUL (or HTTP friendly since I would like to call it in javascript in html, php or any other web pages directly)? 或任何其他实现可扩展RESTFUL的建议(或HTTP友好,因为我想直接在html,php或任何其他网页的javascript中调用它)? Thanks. 谢谢。

The OData V3 does support properties which are a collection of primitive or complex values. OData V3确实支持属性,这些属性是原始值或复杂值的集合。 The WCF Data Services V5 implements this for custom and reflection providers (no support for EF providers yet). WCF数据服务V5为自定义和反射提供程序实现了此功能(尚不支持EF提供程序)。

See for example http://www.odata.org/media/30002/OData%20Atom%20Format.html#collectionofsimpletypedproperties 例如,请参阅http://www.odata.org/media/30002/OData%20Atom%20Format.html#collectionofsimpletypedproperties

The latest WCF Data Services can be downloaded here: http://www.nuget.org/packages/Microsoft.Data.Services 最新的WCF数据服务可以在这里下载: http : //www.nuget.org/packages/Microsoft.Data.Services

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM