http://www.dotnet-tricks.com/Tutorial/webapi/Y95G050413-Difference-between-ASP.NET-MVC-and-ASP.NET-Web-API.html

  • Asp.Net MVC is used to create web applications that returns both views and data but Asp.Net Web API is used to create full blown HTTP services with easy and simple way that returns only data not view.(ASP MVC返回view和数据,Asp.Net Web API只返回数据)
  • Web API helps to build REST-ful services over the .NET Framework and it also support content-negotiation(it's about deciding the best response format data that could be acceptable by the client. it could be JSON,XML,ATOM or other formatted data), self hosting which are not in MVC.(Web API不同形式的数据,比如xml,json等)
  • Web API also takes care of returning data in particular format like JSON,XML or any other based upon the Accept header in the request and you don't worry about that. MVC only return data in JSON format using JsonResult.(MVC只能返回json类型的数据)
  • In Web API the request are mapped to the actions based on HTTP verbs but in MVC it is mapped to actions name.(Web API的http request会根据谓词来map到具体的action上,而MVC根据action name去map到具体的action上)
  • Asp.Net Web API is new framework and part of the core ASP.NET framework. The model binding, filters, routing and others MVC features exist in Web API are different from MVC and exists in the new System.Web.Httpassembly. In MVC, these featues exist with in System.Web.Mvc. Hence Web API can also be used with Asp.Net and as a stand alone service layer.(ASP Web API的各个功能,比如model binding, filters, routing等是在System.Web.Http中实现的,而类似的MVC框架的功能是在System.Web.Mvc中实现的。也就是说Web API和Asp MVC是两套独立的体系)
  • You can mix Web API and MVC controller in a single project to handle advanced AJAX requests which may return data in JSON, XML or any others format and building a full blown HTTP service. Typically, this will be called Web API self hosting.(你可以将Web API和MVC在同一个工程中一起使用)
  • When you have mixed MVC and Web API controller and you want to implement the authorization then you have to create two filters one for MVC and another for Web API since boths are different.(如果你将Web API controller和MVC controller一起混合使用,在他们需要authorization的时候,你必须为实现各自的authorization机制)
  • Moreover, Web API is light weight architecture and except the web application it can also be used with smart phone apps.(Web API是轻量级的架构,可以用在手机程序中)

Asp.Net Web API VS Asp.Net MVC的更多相关文章

  1. ASP.NET Web API和ASP.NET Web MVC中使用Ninject

    ASP.NET Web API和ASP.NET Web MVC中使用Ninject 先附上源码下载地址 一.准备工作 1.新建一个名为MvcDemo的空解决方案 2.新建一个名为MvcDemo.Web ...

  2. 在ASP.NET Web API和ASP.NET Web MVC中使用Ninject

    先附上源码下载地址 一.准备工作 1.新建一个名为MvcDemo的空解决方案 2.新建一个名为MvcDemo.WebUI的空MVC应用程序 3.使用NuGet安装Ninject库   二.在ASP.N ...

  3. 既生瑜何生亮?ASP.NET MVC VS ASP.NET Web API

    Asp.net MVC 与 Asp.net Web API 区别 在我们开发一些web应用时,我们一样可以在MVC Framework 中使用JsonResult 来返回JSON数据,同样也可以处理一 ...

  4. MVC项目实践,在三层架构下实现SportsStore-09,ASP.NET MVC调用ASP.NET Web API的查询服务

    ASP.NET Web API和WCF都体现了REST软件架构风格.在REST中,把一切数据视为资源,所以也是一种面向资源的架构风格.所有的资源都可以通过URI来唯一标识,通过对资源的HTTP操作(G ...

  5. Asp.net MVC 与 Asp.net Web API 区别

    Asp.Net Web API VS Asp.Net MVC 1.Asp.net MVC 是用来创建返回视图(Views)与数据的Web应用,而Asp.net Web API是一种简单轻松地成熟的HT ...

  6. ASP.NET Web API 开篇示例介绍

    ASP.NET Web API 开篇示例介绍 ASP.NET Web API 对于我这个初学者来说ASP.NET Web API这个框架很陌生又熟悉着. 陌生的是ASP.NET Web API是一个全 ...

  7. 使用ASP.NET Web Api构建基于REST风格的服务实战系列教程【开篇】【持续更新中。。。】

    最近发现web api很火,园内也有各种大神已经在研究,本人在asp.net官网上看到一个系列教程,原文地址:http://bitoftech.net/2013/11/25/detailed-tuto ...

  8. ASP.NET Web API 应用教程(一) ——数据流使用

    相信已经有很多文章来介绍ASP.Net Web API 技术,本系列文章主要介绍如何使用数据流,HTTPS,以及可扩展的Web API 方面的技术,系列文章主要有三篇内容. 主要内容如下: I  数据 ...

  9. ASP.NET Web API 2框架揭秘

    ASP.NET Web API 2框架揭秘(.NET领域再现力作顶级专家精讲微软全新轻量级通信平台) 蒋金楠 著   ISBN 978-7-121-23536-8 2014年7月出版 定价:108.0 ...

随机推荐

  1. 10+ commonly using find command switches with example Unix/Linux

    http://crybit.com/find-command-usage-with-example-unixlinux/ find command is one of the best search ...

  2. Helpers\ReservedWords

    Helpers\ReservedWords This helper returns an array of reserved words, this includes php 7's new rese ...

  3. python multiprocess不能完全关闭socket的验证

    近日项目有原来的多线程升级成为多进程模型后,但出现了个问题,在持续运行一天左右系统处理能力开始变慢,并不时打印以下信息: too many opened files 修改ulimit中open fil ...

  4. Android进阶笔记14:ListView篇之ListView性能优化

    1. 首先思考一个问题ListView如何才能提高效率 ? 当convertView为空时候,用setTag()方法为每个View绑定一个存放控件的ViewHolder对象.当convertView不 ...

  5. 数据结构笔记02:Java面试必问算法题

    1. 面试的时候,栈和队列经常会成对出现来考察.本文包含栈和队列的如下考试内容: (1)栈的创建 (2)队列的创建 (3)两个栈实现一个队列 (4)两个队列实现一个栈 (5)设计含最小函数min()的 ...

  6. android网络请求之POST方法

    package com.jredu.helloworld.activity; import android.os.Bundle; import android.os.Handler; import a ...

  7. EXTJS 常用控件的使用

    重要按钮配置项 handler: renderTo: 取得控件及其值 var memo = form.findById('memo');//取得输入控件 alert(memo.getValue()); ...

  8. 笔记——ES5 Array

    ES5里引入了一些新的数组方法.这些方法可以分为两组: 迭代方法和项的定位. 兼容性:chrome,firefox,safari3,及ie8以上都支持 1. every 查询数组中的每一项是否匹配某个 ...

  9. Oracle 中记录用户登录信息

    我们可以使用 Oracle Audit 函数来记录用户登录信息,但是如果开放了 Audit 函数将会使 Oracle 性能下降,甚至导致 Oracle 崩溃.那我们如何才能记录用户登录信息呢?其实我们 ...

  10. 给jdk写注释系列之jdk1.6容器(8)-TreeSet&NavigableMap&NavigableSet源码解析

    TreeSet是一个有序的Set集合. 既然是有序,那么它是靠什么来维持顺序的呢,回忆一下TreeMap中是怎么比较两个key大小的,是通过一个比较器Comparator对不对,不过遗憾的是,今天仍然 ...