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.

原文地址:https://www.cnblogs.com/chucklu/p/6654330.html