Open Closed

CRUD Generator for Master-Child does not work properly for a camel-cased Master Entity #7162


User avatar
0
joachim.penc created

Some routes of a child entity have the wrong name on the server side if the master entity is camel-cased.

  • ABP Framework version: v8.1.1
  • UI Type: Angular
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): no
  • Exception message and full stack trace: 404 (Resource not found)
  • Steps to reproduce the issue:
    • Create a new solution using ABP Suite
    • Create a master entity with a camel-case name, e.g. MasterEntity and generate the code
    • Create a child entity for MasterEntity, e.g. Child and generate the code
    • Notice in the HttpApi project the ChildController.cs with the following 2 methods:
    [HttpGet]
    [Route("by-masterentity")]
    public virtual Task<PagedResultDto<ChildDto>> GetListByMasterEntityIdAsync(GetChildListInput input)
    {
        ...
    
    [HttpGet]
    [Route("detailed/by-masterentity")]
    ...
    
    • The routes attributes should have by-master-entity instead of by-masterentity - so whenever you create a new master entry, the client will show a "Resource not found" because it gets a 404 from the server (the client proxy uses the correct route on the Angular side!)

As a workaround I modified the ChildController.Extended.cs controller by overriding the 2 methods and correcting the route attributes.


1 Answer(s)
  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello,

    Thanks for reporting the issue, we will fix it asap. Your credits will be refunded.

    Thanks

Made with ❤️ on ABP v9.1.0-preview. Updated on December 05, 2024, 12:19