What changed from MVC4 to MVC5?

Asked

Viewed 1,359 times

11

I have read some topics on the subject, some say that it has changed very little, others say that they were very important changes. I would like to know your opinion on the subject, currently I do projects with Webforms so I have no knowledge about MVC, and I bought a book MVC4, this migration worries me a little.

  • 3

    Look, for you to learn the basics is just to study MVC, understand the architecture, do a CRUD, throw basic data back and forth, use objects later, etc. With this you will understand the MVC architecture, Today there is already MVC6, in this already Teva more changes yet. I don’t know everything that’s changed, but I think it’s worth you reading some blogs about it.

2 answers

9

In short, a lot.

Detailing a little more, the most important changes are:

  • Scaffolds updated to support Bootstrap, which is installed by default for new projects;
  • Resource of Scaffolding becomes native to Visual Studio, supporting asynchronous transactions, new feature of Entity Framework 6, standard ASP.NET MVC ORM. Formerly the Scaffolding was made only by Mvcscaffolding, But Mr. Sanderson thought it best to abandon the project and leave a lot of people behind. Recently, a guy named David Douglas Anderson resumed the project, to the happiness of all, so now the community has the two options of Scaffolding, the most powerful command line;
  • Depreciation of ASP.NET Membership and introduction of ASP.NET Identity, more comprehensive and supporting two-factor authentication (confirmation by SMS or email, for example), integration with known Oauth providers (Facebook, Google+, Twitter, etc.) and greater possibilities of customization of this authentication;
  • Major update of Htmlhelper and all its extensions (Linkextensions, Selectextensions, Inputextensions, Editorextensions, Inputextensions, etc..);
  • Introduction of OWIN, new interface specification that will govern all versions of ASP.NET MVC from now on;
  • Decentralization of the startup of the global environment, previously done only by Global.asax.cs, now made by partial classes called Startup;
  • Option to write to routes per attribute in each Action;
  • Web API 2 becomes a design standard embedded in Visual Studio versions 2012 and 2013;

Until the date of this reply, the ASP.NET MVC5 is still the stable version (ASP.NET 5 and MVC6 are still release candidates), but, as the @Maniero response, it is already worth going straight to it at this time of the championship, even because it is very little before the version of the MVC6 becomes stable.

Some changes are quite profound, and I can already talk about some of them:

  • The compiler . NET becomes platform independent (running even on Mac and Linux);
  • Visual Studio is no longer the only official IDE (there is also the Visual Studio Code, platform-independent);
  • In MVC5, it is not possible to take advantage (at least not without some large refactoring) of the logic of a Controller between an MVC application and a Web API 2 application because the implementations of each Controller are very different between them. This should end up in ASP.NET 5 and MVC6;
  • Ioc and DI become project standards. Up to MVC5, it is possible to use Ioc and DI, but through third-party packages and some configuration;
  • Nuget is no longer the only supported package platform. Bower, Grunt and npm support are guaranteed;
  • The Scaffolding is now done using Yeoman, and no longer the Visual Studio IDE.

I may have to edit this answer a few times, because MVC6 will stabilize soon. I ask everyone to remind me when something lags or if I’ve forgotten some important detail, so I can further improve this answer.

  • 1

    Man, thank you so much helped, some things I already knew but helped, the two answers were clear and enough, thanks again, hug!

7


There is a official page saying what the news was, you don’t have to use opinions that are not accepted here. Essentially everything you learn in 4 can be taken advantage of in 5. There are important changes also in subsequent versions, 5.1, 5.2.

If you just want to know if the book is lost or not, of course not. But learning from younger material is always better. The important thing is to learn everything correctly.

In fact, if it’s going to start, I would think about ASP.NET Core. This has had more important changes. It is the future, worth investing in it. Previous versions are considered legacy.

  • So @bigown is that there is currently no translation in Portuguese for the mvc5 books, much less for 6. I ended up finding this book: "Web development with ASP.NET MVC (Version 4) - casadocodigo" after all you said it was better I learn directly in 6.

  • 1

    Make up for it. If you don’t know English and you don’t have anything better, that’s what you can use. I don’t particularly like books in Portuguese, it’s very rare to have some good ones. I don’t know this one, but it’s supposed to break a branch for people who don’t know anything about it. I just hope he doesn’t teach you how to do wrong things, like some books do. You can start with an older version but then you’ll probably want to learn the newer ones. If you don’t have any material, you’ll stand still?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.