Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Advantages of Razor Pages?

$
0
0

Hi, i'm reading and trying out the new razor pages, but I see no particular advantages in using this feature. What are your thoughts and am I wrong on this:

1) Razor pages are not easier to make or easier for beginners as an intruduction to asp.net core. So in my mvc project adding a razor page section is not quicker than adding a normal view folder and a controller. In fact, usually the mvc style has less code and files as the controller can be used for many views, whereas the razor page behind is for a specific view(razor page). Also, you usually have another layout view and viewimports file there that is not always wanted.

For beginners the razor pages are more confusing. The name itself is confusing because we already have the name "razor" for a view in mvc. Why not call it something more specific? Also the classic code behind style where also the viewmodel can be placed can quickly become spaghetti land. Furthermore, i'm worried because it seems to me that Microsoft is really pushing razor pages as the standard way of creating an asp.net core app. Is this going to be the way to do it, while asp.net core web api is the only other alternative (bercause single page apps would then be the client)?

2) performance. This would for me be the biggest reason to use razor pages. But do they give any performance benefit? I have read nothing about this and as far as I can test, it seems to have the same startup speed as normal mvc views?

3) Some things can't easily be used by razor pages, like view components. Partial views can be used but that is not as practical if you have more advanced features.

Are there any other benefits to razor pages? Please, I really want to know!! All who answers will be given green because my questions aren't specific and all answers are right on this.


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>