ASP .Net Core with Razor Pages Vs Angular for UI

Ganu picture Ganu · Jun 3, 2019 · Viewed 10.7k times · Source

Our enterprise application is a massive (1000+ pages) app and primarily it is glorified data entry application. There is no major business process. All most all pages have CRUD. We are trying to re-architecture the entire application from a old code base (C/C++) - desktop app to web based app.

We started with Angular but with limited to NO knowledge on Javascript, it was a steep learning curve. FYI: All our developers know C#. We find it very difficult to on-board new developers into Angular/Javascript world.

All that said, I was looking into ASP .Net Core + Razor Pages and find it way easier to transition when compared to Angular. These are the advantages I have seen so far:

  1. Handle C# POCO within the HTML for binding. No need to convert to TS based POCO's.
  2. Model level validation using data annotations
  3. Default routing or custom routing at API level. One place to define the routing.
  4. Minimal JavaScript use. FYI: Trying to use WebAssembly as well. We are also looking into Blazor

Since it is a data entry system does client side rendering vs server side rendering, matter much?

Are there better advantage choosing Angular with .Net Core Web API over ASP .Net Core 2 + Razor Pages?

Answer

enet picture enet · Jun 3, 2019

To start from the end, I'd advice you to use Blazor server-side SPA application.

Why use SPA

SPA is similar to desktop applications in its design And it's most suitable to be used with data entry forms I guess your team is made of desktop app (WinForms, WPF) developers, and they would easily start developing once they comprehend the Component Model on which Blazor or any other SPA framework is based.

Why use Blazor

  • Your developers are well-acquainted with C#, and has poor knowledge of JavaScript
  • Learning curve of JavaScript + SPA framework, such as Angular is much more higher than Blazor, whether you know JavaScript or not.

Note: It must be emphasized here that the ability to develop Blazor applications requires some learning investment, though not as high as, say, Angular, even if you are a well-experienced Razor Pages or MVC developer. Note also: Knowledge of C# (language), does not reflect Knowledge of (Asp).Net Core Framework.

  • Shared Libraries: This is one of the factors why to use Blazor. In Blazor, you can create projects that can be shared on the Client and the Server. As for instance, you can create your Model in a Shared project, and use it on both sides.

Why use Blazor server side

Blazor server side is most appropriate for enterprise applications running in private network.

  • All the resources are under your control
  • You don't have to use web requests. You can use services which access your database directly or through repositories.
  • Unlike public server-side Blazor, private server-side Blazor, especially one for your corporate is not likely to incur any meaningful Network latency, if at all.

You can really create fast and robust and desktop-like app that way

Hope this helps...

Note: I did not finish my answer, and I'll update it from time to time. Please, don't hesitate to ask whatever question you want.