Last post Jan 07, 2021 02:49 AM by SurferOnWww
Jan 06, 2021 07:37 PM|rkrex|LINK
I was wondering is it a best practice to use Razor Pages with .Net Core MVC? If so how should I architect my application? Thanks !!!!
Jan 06, 2021 08:31 PM|bruce (sqlwork.com)|LINK
while you can use both, typically you'd pick one or the other. If you like the MVC pattern, use MVC otherwise use razor pages.
MVC/Razor Views or Razor pages are just the UI layer. You should architect you app along standard practices, using layers, tiers, etc.
Jan 07, 2021 02:49 AM|SurferOnWww|LINK
I cannot tell the "best" for you as I do not know your knowledge, preference, circumstance and other reasons to select the MVC or Razor Page.
So you will have to decide which way to go considering pros and cons of MVC and Razor Page against your knowledge, preference, circumstance and other reasons. Although Google will provide you with a lot of hints to help your decision, one thing I suggest
you to consider is the image shown in the following article:
ASP.NET Razor Pages vs MVC: How Do Razor Pages Fit in Your Toolbox?
I think the image shown in the above article is self-explanatory to know the pros and cons. If you develop a new project and its content can easily be structured on page basis rather than the MVC structure, probably the choice will be the Razor Page.
As a matter of fact, in the MVC application with ASP.NET Core Identity generated by the Visual Studio 2019, all the pages used for the authentication such as the Login and Resister are supplied as the Razor Class Library (RCL).