What are the differences between WebAPI and WebAPI 2

http://stackoverflow.com/questions/21298961/what-are-the-differences-between-webapi-and-webapi-2

Major new features are,

1. AttributeRouting
2. OWIN self host
3. IHttpActionResult
4. CORS
5. HttpRequestContext

I had the same question and found simple article about this, here.

 

In addition to the features mentioned by iJay

  1. Testability

  2. ODATA Improvements

  3. Filter Overrides

  4. ByteRangeStreamContent

We can differentiate web api and web api2 by using above features.

 

How to check the asp.net web api version in project?

https://forums.asp.net/t/2102345.aspx?How+to+know+the+web+api+project+version+

You should be able to check and see if you have a Web API Nuget package within your project, which should give you an idea of the version being used, v4.x will indicate Web API 1 and v5.x will indicate Web API 2 :

IIRC, Web API 2 was released to coincide with the release of Visual Studio 2013, so it should be available / installed on there.

 

https://stackoverflow.com/questions/30330865/how-do-you-know-the-web-api-version-of-your-project

By default a MVC 4.0 template ships with version 4.0.20710.0 of WebAPI (aka Web api 1). To check this, open your solution, exapnd the webapi solution, then open the packages.config file that holds the nuget config for what you have installed. If you have not updated the packages you should see this.

<package id="Microsoft.AspNet.WebApi" version="4.0.20710.0" targetFramework="net40" />

You can now go to the nuget website and examine the package history here. I have copied the contents of this page below. As you can see this version of web api was release on 11th Aug 2012. This version was better known as "web api 1" after Web API 2 was release around Jan 2014. You can upgrade you MVC4 project to use Web API 2 if you wish by using the nuget update wizard.

 

作者:Chuck Lu    GitHub    
posted @   ChuckLu  阅读(242)  评论(0编辑  收藏  举报
编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
历史上的今天:
2016-04-01 SuperSocketClientEngine
2015-04-01 .NET_Framework_version_history
2015-04-01 Tuple元祖
点击右上角即可分享
微信分享提示