Skip to main content

Difference between MVC 3, MVC 4, MVC 5, and MVC 6


ASP.NET MVC 3:

1.    MVC 3 introduced a popular new features that is called Razor.



2.    MVC 3  introduced a new features that is called bundling.



3.    MVC 3 Start supporting to multiple view(Razor) engines.



4.    MVC 3 introduced a popular new features that is called ViewBag dynamic property.



5.    MVC 3 introduced a popular new features that is called ActionResults Types.



6.    In MVC 3, added  separates the functionality approach over the JavaScript in the presentation layer  that is called to UX.



7.    MVC 3 start supporting to the HTML 5 and CSS 3.



8.    MVC 3 added enhancement to validate a model.



9.    MVC 3 improved the Dependency Injection by using the IDependencyResolver interface.



10.  MVC 3 added output caching for Partial views.



ASP.NET MVC 4:

1.    MVC 4 introduced a popular new features that is called webapi  framework. and its work over the HTTP services .



2.    MVC 4 added and improve to default project templates.



3.    MVC 4 introduced to empty project template.



4.    MVC 4 introduced to new mobile project template.



5.    MVC 4 is going to support and adding controller to other project folders.



6.    MVC 4 is going to support the Asynchronous Controllers.



7.    MVC 4 introduced to bundling and Magnification concepts.



8.    MVC 4 introduced to OAuth and OpenID login with the help of DotNetOpenAuth library.



9.    MVC 4 going to support to Windows Azure SDK 1.6.





ASP.NET MVC 5:

1.    MVC 5 introduced to ASP.NET Identity for authentication and identity management.



2.    ASP.NET Identity is a new Membership provider to handle the authentication and authorization for social networking site just like Google, twitter, face-book etc.



3.    MVC 5 added  to authentication filters for authenticate to users using  third party authentication provider or your custom logic by using filter override methods and now we can override to filters on  method and  controller both.



4.    MVC 5 replaced to bootstrap by using the default template.



5.    MVC 5 added new to Attribute Routing [Route("Empolyee/{EmpID}")].



Example code look like.

[RoutePrefix("API/Company")]

public class CompanyController : BaseAPIController



{

        [Route("Employee/{EmpId}")]

        public ActionResult GetEmployeeById(string EmpId)

        {

            //TODO: Put your logic here.       

            return View();

        }
}

The Attribute Routing work with both ActionResult and Controller Level. 



Now, In MVC 5

  1. Empty Template
  2. Internate Application Template
  3. Intranet Application Template
  4. ASP.NET Web API Template
  5. Mobile Project Template
  6. Single Page Application Template
  7. Asp.Net Identity
  8. Bootstrap in the MVC 5 templates
  9. Authentication Filters
  10. Filter overrides



ASP.NET MVC 6:

1.     MVC 6 added new cloud computing optimization system of MVC , web API, SignalR and entity framework.



2.    The Microsoft  make a bundle of MVC, Web API, WebPages, SignalR , That bundle we called MVC 6.



3.    In MVC 6, Microsoft removed the dependency of system.web.dll from MVC 6  because it's so expensive. Typically  it consume 30K memory per request/response.



4.    Right now, in MVC 6 consume 2K  memory per request response. It's too small memory  consume.



5.    Most of the problem solved using the Roslyn Compiler.



6.    The ASP .Net  vNext used the Roslyn Compiler,  By using Roslyn compiler do not need to compile the application Its  compile automatically the application code.



7.    The .Net vNext is a cross platform and open source.





8.    The .Net vNext has the new project extension project.json. Basically project.json contain the all dependency dll of the application.

In MVC 5.1 and 5.2 support to Enum and EnumHelper in  razor views.

Comments

Popular posts from this blog

What is cookie? Advantages and disadvantages of cookies?

What is cookie? A cookie is a small piece of text file stored on user's computer in the form of name-value pair. Cookies are used by websites to keep track of visitors e.g. to keep user information like username etc. If any web application using cookies, Server send cookies and client browser will store it. The browser then returns the cookie to the server at the next time the page is requested. The most common example of using a cookie is to store User information, User preferences, Password Remember Option etc.It is also one of the common and mostly asked interview questions. Some facts about Cookie Here are a few facts to know about cookies: · Cookies are domain specific i.e. a domain cannot read or write to a cookie created by another domain. This is done by the browser for security purpose. · Cookies are browser specific. Each browser stores the cookies in a different location. The cookies are browser specific and so a cookie created in one browser(e.g in Google Chrome...

Code First Getting Started

In this tutorial let us create a simple application to demonstrate the use of entity framework using code first. We are using Visual Studio 2015 and entity framework 6.1.3. You can download Visual Studio community Edition . You should have the basic knowledge of .Net framework, C# and MS SQL Server. In this tutorial, we will create a simple application with a user class.  Our user class will have basic information like name and email address of the user. Create the Project Open Visual Studio. File ->New -> Project Select C# -> Select Console Application Name the application as “EFGettingStarted” Click on OK Install Entity Framework The next step is to install the Entity framework. This can be installed via nuget package console. Click on Tools->Nuget Package manager -> Package Manager Console and type the following command C# 1 2 3   install - package entityframework   This will in...

Top 10 ASP.NET Web API Interview Questions

What is ASP.NET Web API? ASP.NET Web API is a framework that simplifies building HTTP services for broader range of clients (including browsers as well as mobile devices) on top of .NET Framework. Using ASP.NET Web API, we can create non-SOAP based services like plain XML or JSON strings, etc. with many other advantages including: Create resource-oriented services using the full features of HTTP Exposing services to a variety of clients easily like browsers or mobile devices, etc. What are the Advantages of Using ASP.NET Web API? Using ASP.NET Web API has a number of advantages, but core of the advantages are: It works the HTTP way using standard HTTP verbs like  GET ,  POST ,  PUT ,  DELETE , etc. for all CRUD operations Complete support for routing Response generated in JSON or XML format using  MediaTypeFormatter It has the ability to be hosted in IIS as well as self-host outside of IIS Supports Model binding and Validation Support for OD...