Wednesday, March 18, 2015

Difference between MVC2,3,4,5 and 6

MVC 6

ASP.NET MVC and Web API has been merged in to one.
Dependency injection is inbuilt and part of MVC.
Side by side - deploy the runtime and framework with your application
Everything packaged with NuGet, Including the .NET runtime itself.
New JSON based project structure.
No need to recompile for every change. Just hit save and refresh the browser.
Compilation done with the new Roslyn real-time compiler.
vNext is Open Source via the .NET Foundation and is taking public contributions.
vNext (and Rosyln) also runs on Mono, on both Mac and Linux today.

MVC 5

One ASP.NET
Attribute based routing
Asp.Net Identity
Bootstrap in the MVC template
Authentication Filters
Filter overrides

MVC 4

ASP.NET Web API
Refreshed and modernized default project templates
New mobile project template
Many new features to support mobile apps
Enhanced support for asynchronous methods

MVC 3

Razor
Readymade project templates
HTML 5 enabled templates
Support for Multiple View Engines
JavaScript and Ajax
Model Validation Improvements

MVC 2

Client-Side Validation
Templated Helpers
Areas
Asynchronous Controllers
Html.ValidationSummary Helper Method
DefaultValueAttribute in Action-Method Parameters
Binding Binary Data with Model Binders
DataAnnotations Attributes
Model-Validator Providers
New RequireHttpsAttribute Action Filter
Templated Helpers

Display Model-Level Errors




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.

No comments:

Post a Comment