Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

[Re-gen Entity] Recommended approach to avoid modifications #5238


User avatar
0
kpmg created

Hi,

For an actual project we want to modify and extend the frontend .html/.ts files which are generated with the help of the VS "Create an Entity"-Plugin.

Unfortunately the Entities will change in the future.

I think the backend should not be a problem, because it generates Micration classes. But in the frontend it just delete the files?

What is the recommended way to avoid loosing modifications, if we want to use the "Re-generate an Entity" for this? Like I have seen it would completely remove all the change which are done in the corresponding files?

I thought about using a git-repository to merge the old changes and the new generated files.. but I think there should be easier/better ways to do it?

Regards


3 Answer(s)
  • User Avatar
    0
    bbakermmc created

    You dont :) So our process uses GECO (<a class="postlink" href="https://github.com/iQuarc/Geco">https://github.com/iQuarc/Geco</a>) to generate our code, we ended up creating everything as partials so that way we dont modify the ABP files directly. This helps with merging, especially when you create over 5k files per generation :). For the UI pages we created a folder called "Generated" the generator puts those files there, if we then "modify" them, we move it to the root folder that way if we generate later we dont touch the modified files and can now diff the two files.

    Wont you have the same issue if you regenerate app services and such also and added custom methods and dont partial them?

  • User Avatar
    0
    bbakermmc created

    I did a little write up here:

    <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/issues/1262">https://github.com/aspnetzero/aspnet-ze ... ssues/1262</a>

  • User Avatar
    0
    alper created
    Support Team

    Thanks @BBakerMMC for your effort on upgrading AspNet Zero.