Scaffold admin CRUD in .net core SPA Angular

1.1k views Asked by At

Is there a way to scaffold angular components + module for .net core api CRUD controllers? Or how to extend the existing scaffolding code in order to generate crud components + module for angular? Especially, I would like to generate forms and their unobtrusive validation

2

There are 2 answers

0
Fei Han On

Is there a way to scaffold angular components + module for .net core api CRUD controllers?

As far as I know, currently the ASP.NET Core code generator and scaffolding engine support scaffolding area, controller, identity, razorpage and view. It does not support automatically generating crud components for Angular.

For more information, please refer to this doc:

https://learn.microsoft.com/en-us/aspnet/core/fundamentals/tools/dotnet-aspnet-codegenerator?view=aspnetcore-5.0#arguments

0
JackPat99 On

You can do that with a code generator like Telosys (https://www.telosys.org/). You can even generate your REST controllers if you want.

You will have to define your entities in a model (if you have a relational database you can generate a "Database-model" or else you can create a "DSL-model").

Then you can reuse existing templates to generate Angular code (exemples are available here : https://github.com/telosys-templates-v3/angular4-rest-frontend) and customize them to generate exactly what you want (each template is customizable).

For a Telosys overview see this post : https://modeling-languages.com/telosys-tools-the-concept-of-lightweight-model-for-code-generation/