选择与 asp.net-mvc 一起使用的 REST 框架
我已经使用 asp.net mvc 构建了我的网站,它基本上与我的服务层通信。服务层的设计使得外部应用程序可以作为 API 调用它(可能类似于 twitter)。
可以把它看作是一次彻头彻尾的推特诈骗。使用的功能:
- 身份验证(密码、facebook、twitter、OpenID)。
- 对数据进行 CRUD。
现在我的问题是选择一个 RESTful API 框架。我在想以下问题:
- 如果我使用asp.net mvc,我是否会受到限制?例如,页面生命周期等。
- 我试图远离 WCF,因为我听说它太大且笨重。
- ADO.NET 数据服务与我的应用程序设计的配合程度如何?
- OpenRasta 怎么样?
我想我设计的服务层和 mvc 应用程序(会话等)到目前为止都是水平扩展的。不确定 API 需要什么来扩展。
I already have my site built using asp.net mvc, which basically talks to my service layer. The service layer is designed so that outside applications can call into it as an API (probably similar to twitter).
Think of it as an exact twitter rip off. Features used:
- Authentication(password, facebook, twitter, OpenID).
- CRUD on data.
Now my problem is selecting a RESTful API framework. I was thinking about the following:
- If I use asp.net mvc, will I be restricted in anyway? For eg, page lifecycle, etc.
- I'm trying to keep away from WCF as I've heard its too large and bulky.
- How well would ADO.NET data services mesh with my app design?
- What about OpenRasta?
I think I designed both my service layer and the mvc app(sessions, etc) to scale horizontally so far. Not sure what is needed for the API to scale.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我知道你提到想要远离 WCF(正确的),我可以理解。
根据您的要求(这是一个关键任务网站吗?以盈利为目的?),我建议您至少查看 WCF Web API< /a>.这不是最终版本,因为新的预览版本刚刚在 Mix 11 中删除,因此如果您的要求要求更多产品就绪,那么我会引导您采用 jdangelo 提到的内容。除此之外,我发现 Web api 非常有趣。
有关框架提供的内容的良好概述和示例,请查看 Alex Zeitler 的演练。
还有可用的 NuGet 包(搜索 WebApi)和示例,以进一步向您展示可以做什么完成吧。
I know you mentioned wanting to stay away from WCF (proper) and I can understand that.
Depending on your requirements (is this a mission critical site? for profit?) might I suggest at least looking at the WCF Web API. This isn't a finalized release as a new preview build was just dropped at Mix 11 so if your requirements dictate something more PROD ready then I'd steer you towards what jdangelo mentioned. Otherwise, I've found the web api to be pretty enjoyable.
For a good overview and example of what the framework offers take a look at Alex Zeitler's walkthrough.
There are also NuGet packages available (search WebApi) with samples to further expose you to what can be done.