ASP.NET MVC 6 Features
Finally ASP.NET 5 aka ASP.Net vNext has been released which is a new open-source and cross-platform framework for building modern cloud-based Web applications using .NET. Yes you heard it right Open Source. With this version, ASP.NET becomes an open source framework available on GitHub and you’ll be able to build and execute ASP.Net 5 applications on Windows, Linux, or even Mac OS X.
Also MVC 6 is also part of ASP.NET 5 which is a very big change to how Microsoft constructs web frameworks.
In this article I will be introducing you to some of the new features or changes that are introduced in ASP.NET MVC 6
Cloud Optimized Framework
With MVC 6, Microsoft removed the dependency of System.Web.Dll since it is quite expensive.
A typical HttpContext object graph can consume 30K of memory per request but With MVC 6 it is reduced to roughly 2K.
As the framework is cloud-optimized, you can keep a copy of the mono CLR for different websites side by side. Thus you'll be able to run a different CLR version for each site. Due to this you don’t need to upgrade the .NET version on the entire machine.
MVC 6=MVC + Web API + Web Pages
In Asp.NET 5 ASP.NET MVC, WEB API and Web Pages have been unified and merged into one single unified framework called as MVC 6.
Microsoft did this as many developers had a perception that all three technologies are disjoint and distinct as you can create web applications from any of them.
But this is not true .So unified framework will change this perception. Now in Asp.NET 5 you can use same template for creating web pages, MVC application and Web API
Roslyn compiler
ASP.NET vNext introduced to us a next generation compiler called Roslyn.Roslyn is an open source compiler platform and because of its dynamic compilation we can just make the changes in the code and need to just refresh the browser to reflect our changes.
Dynamic Compilation: **** Dynamic compilation is the practice of delaying compilation of a program (translation from a source language to a target language; the latter usually being the instruction set of the underlying microprocessor) until the time that the program is loaded or run.
Dependency injection
In MVC 6 dependency injection is supported across all the technologies, WebAPI , MVC and Webpages. A default dependency injection container is provided out of the box.
This means that you no longer need to rely on third-party Dependency Injection frameworks such as Ninject or AutoFac.