简体   繁体   English

使用odata或MVC返回json?

[英]use odata or MVC to return json?

I am trying to use ajax to do CRUD. 我正在尝试使用Ajax进行CRUD。 Should I use ODATA or MVC? 我应该使用ODATA还是MVC? i am also planning to use json in mobile platform as well. 我还计划在移动平台上也使用json。

Thanks guys 多谢你们

Somewhat subjective - but the two key things with ODATA are that a) huge amounts of heavy lifting is done for you at the server end and b) that there are also libraries to help at the client end. 主观上有些主观-但是ODATA的两件主要事情是:a)在服务器端为您完成了大量繁重的工作,并且b)在客户端也有库可以提供帮助。 Downside is that you have to do what it does although since you're pointing it at entities that can be quite complex and is flexible. 缺点是您必须做它要做的事情,尽管由于您将它指向可能非常复杂和灵活的实体。

With MVC you have to do all your own work but in return you get exactly what you need. 使用MVC,您必须做所有自己的工作,但作为回报,您将获得所需的东西。

All other things being equal, I'd probably start with ODATA... 在所有其他条件相同的情况下,我可能会从ODATA开始...

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

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