Search code examples
aspnetboilerplate

How to auto generate web api js for custom entity CRUD methods?


I can see that in the Angular 5 UI Project we have a file \src\app\shared\service-proxies.ts

it seems to be an auto generated file:

//----------------------
// <auto-generated>
//     Generated using the NSwag toolchain v11.12.9.0 (NJsonSchema v9.10.9.0 (Newtonsoft.Json v9.0.0.0)) (http://NSwag.org)
// </auto-generated>
//----------------------

I need to create a new component for crud on a custom entity. I have the menu item and routing working but i'm having trouble understanding the doco for how this file service-proxies.ts actually gets generated.

i can only assume it has something similar to this link

Can anybody shed some light on this?

Thanks


Solution

  • OK, so here is the answer:

    Step 1: make sure your host is running

    Step 2: in the angular project locate the nswag folder

    Step 3: run the refesh.bat file

    this should produce the updated file for service-proxies.ts

    too easy...once you know! :-)

    PS: if you are using angular 5 you will need

    https://github.com/aspnetboilerplate/module-zero-core-template/releases/tag/v3.4.0