Base solution for your next web application
Open Closed

Re-generate An Entity not working as I expected #6627


User avatar
0
jtallon created

Hello,

I created an entity using the tool. However I later wanted to use the powertool again but this time to "Re-generate An Entity". I did the following:

  1. Rename some properties
  2. Remove some properties
  3. Add some new properties
  4. Remove a navigation property (eg ANOTHER_ENTITYId)

After I clicked "Generate" I saw that the web app was working as I expected.

I then:

  • cleaned
  • rebuilt
  • re-run the web app

Swagger was as I expected.

I then go into angular and run .\nswag\refresh.bat which completed ok.

However when I start the app I get the following errors:

ERROR in .../create-or-edit-ENTITY.component.ts(56,48): error TS2339: Property 'ANOTHER_ENTITYName' does not exist on type 'GetENTITYForEditOutput'.
.../create-or-edit-ENTITY.component.ts(81,60): error TS2339: Property 'ANOTHER_ENTITYId' does not exist on type 'CreateOrEditENTITYDto'.
.../create-or-edit-ENTITY.component.ts(88,21): error TS2339: Property 'ANOTHER_ENTITYId' does not exist on type 'CreateOrEditENTITYDto'.
.../create-or-edit-ENTITY.component.ts(94,21): error TS2339: Property 'ANOTHER_ENTITYId' does not exist on type 'CreateOrEditENTITYDto'.
.../ANOTHER_ENTITY-lookup-table-modal.component.ts(3,30): error TS2305: Module '".../shared/service-proxies/service-proxies"' has
no exported member 'ANOTHER_ENTITYLookupTableDto'.
.../ANOTHER_ENTITY-lookup-table-modal.component.ts(55,35): error TS2339: Property 'getAllANOTHER_ENTITYForLookupTable' does not exist on type 'ENTITYServiceProxy'.
src/app/main/main.module.ts(5,10): error TS2300: Duplicate identifier 'ENTITYComponent'.
src/app/main/main.module.ts(6,10): error TS2300: Duplicate identifier 'ViewENTITYModalComponent'.
src/app/main/main.module.ts(28,10): error TS2300: Duplicate identifier 'ENTITYComponent'.
src/app/main/main.module.ts(29,10): error TS2300: Duplicate identifier 'ViewENTITYModalComponent'.

Is there something else I need to do to "synchronise" the changes for the Angular world? Or do I need to manually clean up the files?


2 Answer(s)
  • User Avatar
    0
    yekalkan created

    You need to fix those errors by yourself. Error messages explain what you have to do, but you can contact again if you are having any trouble.

    Most of the times, Re-generate progress ends without any problem. However, in some situations, when modification on entity is heavy, tool may not be able to delete the old code.

    See this answer https://support.aspnetzero.com/QA/Questions/6498#answer-5a65ea25-68c6-4b94-1823-39ec1166ee61

  • User Avatar
    0
    jtallon created

    Thanks, I noticed also after the fact that the views were custom ones which were copies of the generated one.