MVC vs Razor Pages
Hello guys, I am currently learning .NET and web dev in general. And I've seen there are at least 2 ways to build and app. Using MVC or Razor pages. As far as I understand these 2 are just the way you organise your app, it's structure and they are pretty similar. Razor pages app actually looks like simplified MVC app. So my question is which is more commonly used nowadays and which is "better"( if you can say one is)?
3 Replies
Far as common usage, MVC is probably more used overall, when we include all the enterprise applications and what not
Microsoft recommends RPages for new projects, though
Far as which is better... depends. RPages certainly has better structure to it
While MVC allows you to do more, like one action conditionally returning one of many views
That said, you can always mix and match them
Isn't that considered bad manners or something? Because it kinda makes your app look not very consistent?
This
Whatever gets you to the goal
Some people will be purists like that, some will stuff Razor Pages, MVC, and a WebAPI into a single project, because it's the easiest way to go lol