Open Closed

How to create Angular Code(rest API and Model), when I added new DTO and new api manually after suite generated CRUD. #1539


User avatar
0
abpVAndy created

ABP Framework version: v4.3.3 UI type: Angular DB provider: EF Core Tiered (MVC) or Identity Server Separated (Angular): yes

With suite, I create some entity and angular CRUD UI. All works. Now, I need to add some DTO and Api, which are special, and need I manually to add them.

My question is: How should I create DTO Model and Api in the Angular Part?

I try to use Cli "abp generate-proxy", it seems work for it. But I see the code created by Suite and Cli are different.

Test: I use suite to create entity "Order" and "OrderItem" for both backend and frontend (Angular), all works. Then, I use Cli "abp generate-proxy" to do one more time. the code are different. But all works.

So I worry about, if I use suite to create most my code. And I need to manually add DTO and Api, with Cli, they are different.


2 Answer(s)
  • User Avatar
    0
    bunyamin created

    Hello,

    generate-proxy command generates code from a running backend which makes it more reliable. suite, on the other hand, does its best to simulate a running backend, so there are some differences between them. We'll check it out and try to minimize the diff. As to answer your question, generate-proxy is better choice for proxy generation. Let's say you've created bunch of entities with suite which generates components as well as services, and then you run abp generate-proxy which may change some of the files generated by suite. If it doesn't break your code, use the code generated by generate-proxy.

    If you could share your entity.json, I'd try to find out why there is a diff.

  • User Avatar
    0
    ServiceBot created
    Support Team Automatic process manager

    This question has been automatically marked as stale because it has not had recent activity.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 13, 2024, 06:09