Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP .Net Core with Razor Pages Vs Angular for UI [closed]

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?

like image 752
Ganu Avatar asked Jun 03 '19 06:06

Ganu


5 Answers

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.

like image 75
enet Avatar answered Sep 25 '22 11:09

enet


This is a highly opinionated question but in general, Single Page Applications require an effort a few orders of magnitude larger than Server rendered pages. You will have to duplicate logic on the C# backend and the typescript front-end. You will have to deal with tons of bugs as you code the front-end in a non type safe dynamic language that has arguably questionable constructs. In the end, Single Page Apps are worth it because they provide a rich and engaging experience to the end user if done properly. But getting there is an uphill battle.

Considering the experience of your developers, I would recommend doing it in Razor Pages or MVC and gradually introducing bits of Angular/React code to areas of the front end that require enhancements.

In other words, do the whole thing in Razor Pages/MVC, pick a small area, branch the middleware pipeline and serve a small Angular app.

like image 26
Avin Kavish Avatar answered Sep 24 '22 11:09

Avin Kavish


Since most of your app is simple CRUD, consider using just razor/MVC.

Use Visual Studio + ASP.NET core + EF Core to automatically reverse engineer the database into models and database context. Then automatically generate (scaffold) the controllers and views for all CRUD operations. Sprinkle additional data annotations where needed.

And where you need more advanced data display/interaction (e.g. Grid, Calendar, ...) consider 3rd-party Javascript widgets. They don't require JavaScript expertise.

like image 25
MilletSoftware Avatar answered Sep 24 '22 11:09

MilletSoftware


Depends on your needs. Your company is full of C# developers so going to angular will increase the time and complexity of a project. Also since this is a web application that is meant for data entry in a corporate enviroment you don't care about loading times and optimization as much as you would in a commercial application. Generally try to develop using a ASP.NET Core framework with razor, and try to move to angular with a smaller project. That is my opinion. You want to deliver a technical solution that fits the needs of your company and keep development cost down, this should be the main axis that you make choices.

like image 2
A_kat Avatar answered Sep 26 '22 11:09

A_kat


For enterprise developer, I think we are more focus on business logic layer rather than UI design like SAP ABAP development that UI is generated by framework or library. I prefer to use strong type no matter front end or back end. It saves a lot of time and avoid typo bugs especially team development.

For example, a Sales Order input screen like below, we just need to create model with attributes and do configuration. The library will generated input and search screen.

  1. Model

Model

  1. Input screen

Input screen

  1. Search configuration

Search configuration

  1. Search screen

enter image description here

like image 2
Wilson Wu Avatar answered Sep 25 '22 11:09

Wilson Wu