Open Closed

Feature Request - abp Suite - Shared classes with 2 generated files. #2344


User avatar
0
beriniwlew created

I'm wondering if you could add a new feature to abp Suite to generate shared classes with two files such as this:

BookDto.cs <- Developer can modify this to their specialized needs BookDto.generated.cs <- Generated class by abp Suite - Developer does not modify this

This way, we can continue to regenerate these entities without overwriting any custom work that we may do.

Thank you!

-B


7 Answer(s)
  • User Avatar
    0
    Sturla created

    I would go further and do it with services and controllers also!

    I´m always adding something custom and its a pain to update. Nb. I´m not still gone live so I can iterate fast but would love to do it even faster!

  • User Avatar
    0
    alper created
    Support Team Director

    creating a "generated.cs" file is a partial solution of not overwriting your custom code, what about injecting code in existing classes (DbContext, Permissions, MenuProviders etc..) ?

  • User Avatar
    0
    alper created
    Support Team Director

    I would go further and do it with services and controllers also!

    I´m always adding something custom and its a pain to update.
    Nb. I´m not still gone live so I can iterate fast but would love to do it even faster!

    can you give details and concrete examples about your solution

  • User Avatar
    0
    Sturla created

    can you give details and concrete examples about your solution

    My services/controllers have more functions than just related to talking to the database so I have stuff like

    public interface ICarsAppService : IApplicationService
    {
        Task<CarsDto> GetAsync(Guid id);
        // ...etc. CRUD stuff from Suite
        
        //And then I have custom stuff like this that is not db/crud related
        Task UploadCarImageBlobAsync(string blobName);
        // ...etc
        // all of this gets removed and I need to add it again...
    }
    

    But then I also have changes in the CRUD methods e.g. swapping out their content and calling a Manager.

    And then Suite also removes all the extra private readonly members (and from the constructors) so I need to add it all back in.

    Now I try to add all my changes to code at the bottom so its easier to update with suite. I just copy/paste the removed code back in!

    Why not just keep what is not ABP Crud? Why delete it all?

    And since we are at it... can we have Suite also have the possibility to have a this. option instead of having all members starting with _ ?

  • User Avatar
    0
    Sturla created

    And one more thing... can you please not remove the comments I put on my properties? That would be awesome ;-)

  • User Avatar
    0
    beriniwlew created

    creating a "generated.cs" file is a partial solution of not overwriting your custom code, what about injecting code in existing classes (DbContext, Permissions, MenuProviders etc..) ?

    Could some of this be alleviated by creating base classes?

  • User Avatar
    0
    murat.yuceer created

    Maybe generate partial class could be option

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11