Monday, June 20, 2016

Difference Between MVC 4 and MVC 5 and MVC 6

MVC 6 New Features
  • Single Programming Model for ASP.Net MVC and ASP.Net Web API.
  • Out of the box support for dependency injection.
  • Having support of side by side deployment of runtime and framework along with your web application.
  • Optimized for Cloud Computing.
  • Everything packaged with NuGet, including the .Net runtime itself.
  • New JSON based project structure.
  • In order to dynamically compile code, Roslyn compiler is used.
  • No need to recompile for every change. Just hit save and refresh the browser.
  • vNext is Open Source and supports running on multiple platforms including Linux and Mac.

MVC 5 Features
  • ASP.Net Identity for authentication and identity management
  • Attribute Routing is now integrated into MVC5
  • Bootstrap replaced the default MVC template
  • Authentication Filters for authenticating user by custom or third-party authentication provider.
  • With the help of Filter overrides, we can now override filters on a method or controller.

MVC 4 Features
  • ASP.net Web API
  • Modernized default project templates and other look & feel improvements
  • Based on jQuery Mobile, new Mobile Project Template introduced.
  • A truly Empty Project Template.
  • Support for adding controller to other project folders also.
  • Task Support for Asynchronous Controllers.
  • Controlling Bundling and Minification through web.config.
  • Support for OAuth and OpenID logins using DotNetOpenAuth library.
  • Support for Windows Azure SDK 1.6 and new releases.

MVC 3 Features
  • Razor View Engine introduced with a bundle of new features.
  • Improved Model validation.
  • New Project Templates having support for HTML 5 and CSS 3.
  • Having support for Multiple View Engines i.e. Web Forms view engine, Razor or open source.
  • Controller improvements like ViewBag dynamic property and ActionResults Types etc. Dynamic property is a new feature introduced in C# 4.0. ViewBag being a dynamic property has an advantage over ViewData that it doesn’t require checking NULL values. For detailed difference between ViewBag and ViewData can be found here.
  • Unobtrusive JavaScript approach that actually separates the functionality from presentation layer on a web page.
  • Improved Dependency Injection with new IDependencyResolver.
  • Partial page output caching.