ASP.NET MVC 6 is a single aligned web stack on top of ASP.NET for doing web UI and web API. The current web stack contains Web Pages, MVC and Web API as shown in the following picture, they do not share much, Web pages and MVC share razor view engine but beyond that they do not share much example html helpers. Both MVC and Web API have their own Controllers, Actions, Filters and Model bindings
MVC and Web API actually share zero code. MVC has system.web dependency where as Web API do not and can run outside IIS.
What is ASP.NET MVC 6?
select the ASP.NET 5 Starter Web template for creating new ASP.NET MVC 6 application then you are ready to go!
if you do not see the ASP.NET MVC package in project.json file then you can add it to the file
You can open the solution explorer to see the core references and their dependencies
ASP.NET MVC 6 lives on top of new routing middleware model in ASP.NET 5. How do you setup? There is a configure method in Startup.cs file there you can say as shown in the following picture
inside the UseMvc extension method it is adding middleware and sets the MVC as default handler for routing. You can always override and write your own routing paths as shown in the following
Http routing is already there and you do not have to mention explicitly for Web API. Now you also need to add MVC services. By convention it is called ConfigureServices method, middleware and services are different. Middleware sits in HttpRequest pipeline.
You can set the configuration sources in startup file as shown in the following
The dependency injection was used throughout MVC 6 and ASP.NET 5. Now both MVC and Web API sitting on same request pipeline. The modal binding in MVC 6 looks as shown in the following
you can get the modal binding from http header up to post. You can also use FromServices attributes. The same modal binding can be used in web api.