简体   繁体   English

asp.net WebAPI与asp.net MVC控制器的性能发出JSON?

[英]Performance of asp.net WebAPI vs. asp.net MVC controller emmiting JSON?

有谁知道使用WebAPI是否有性能优势,而不仅仅是使用返回JSON的MVC控制器?

I think the benefits are more related to flexibility than performance. 我认为其优势与灵活性相关,而非性能。 You can implement a rest service using the MVC way, but the Web API provides a cleaner model: the actions are implicit in the HTTP verbs, the content can be delivered both in JSON and XML, there is native support to return an IQueryable< T > (this can be seen as a small performance improvement), and it can be integrated with an ASP.NET Web Forms application (or even a console app, with no ASP.NET at all). 您可以使用MVC方式实现休息服务,但Web API提供了一个更清晰的模型:操作隐含在HTTP谓词中,内容可以用JSON和XML传递,有本机支持返回IQueryable <T >(这可以看作是一个小的性能改进),它可以与ASP.NET Web窗体应用程序(甚至是控制台应用程序,根本没有ASP.NET)集成。

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

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