如何在Asp.net中使用MVC Web API。 [英] How to use MVC Web API in Asp.net.

查看:80
本文介绍了如何在Asp.net中使用MVC Web API。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我需要对MVC网络API进行一些澄清。



1.使用MVC web Api

2.如何实现MVC web Api

3. diff b / w正常MVC和MVC web Api

Hi,

I need some clarification on MVC web api.

1. use of MVC web Api
2. how to implement MVC web Api
3. diff b/w normal MVC and MVC web Api

推荐答案

Allrighty,按顺序,问题的深度:



1. WebAPI应用程序提供XML或JSON数据,但不提供客户端的实际视图。将数据解析为视图的所有逻辑必须在客户端,通常作为jQuery或Angular等JavaScript框架。



2.可以在IIS上实现WebAPI ,在OWIN Katana上(可以自我托管或属于任何标准的网络服务器,依赖于中间件),或者作为自托管进程。 IIS实现与MVC实现基本相同。



3. MVC提供消费观点并且相对较重。 WebAPI不提供视图,并且重量轻,但需要编码器提供更多功能,或者更好地将责任区域与团队分离。
Allrighty, in order, by depth of question:

1. A WebAPI app provides XML or JSON data, but not actual views to the client. All logic to parse the data into a view must be on the client side, normally as a JavaScript framework like jQuery or Angular.

2. WebAPI can be implemented on IIS, on OWIN Katana(which can self-host or fall under any standard webserver, middleware dependent), or as a self-hosted process. The IIS implementation is basically identical to an MVC implementation.

3. MVC serves views for consumption and is relatively heavy-weight. WebAPI does not serve views, and is light-weight, but requires more capability from the coder or a better separation of areas of responsibility from a team.


这篇关于如何在Asp.net中使用MVC Web API。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆