Open Closed

Many To Many Nested Nav Properties - Show on list page #6322


User avatar
0
SuperBeastX3 created
  • ABP Framework version: v7.4
  • UI Type: MVC
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): Tiered

I have some nested many to many objects and I want to know what is the preferred way to show the nested items properties on the List page? ObjectA is the main object, it has the many to many edit tab to ObjectB. ObjectB has 1 to many navigation properties to ObjectC. On the edit modal for ObjectA, on ObjectBs list page (for edit and delete), I want to show more navigation properties on ObjectB. What is the proper way to do that? Ultimately, I want an object with full navigation properties all the way down from the starting object available to use on the List page. How should I implement that?


7 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Are you talking about ABP Suite?

  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hi,

    Please check this article https://community.abp.io/posts/many-to-many-relationship-with-abp-and-ef-core-g7rm2qut if find helpful for you?

    Thanks

  • User Avatar
    0
    SuperBeastX3 created

    Yes from ABP Suite. The current template generates a single level dto usually called ObjectWithNavigationProperties. This is great, but if that object has a list collection property with its own different navigation properties, it would be great to auto generate and connect to it as well. Maybe a toggle to specify how far deep to connect the objects navigation properties. I solved my immediate need by basically changing the ObjectWithNavigationProperties -> List<ChildObject> to ObjectWithNavigationProperties -> <ChildObjectWithNavigationProperties>. Abp suite is very powerful, but it just needs a few more items to make it so you don't need to code anything.

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Yes from ABP Suite. The current template generates a single level dto usually called ObjectWithNavigationProperties. This is great, but if that object has a list collection property with its own different navigation properties, it would be great to auto generate and connect to it as well. Maybe a toggle to specify how far deep to connect the objects navigation properties. I solved my immediate need by basically changing the ObjectWithNavigationProperties -> List<ChildObject> to ObjectWithNavigationProperties -> <ChildObjectWithNavigationProperties>. Abp suite is very powerful, but it just needs a few more items to make it so you don't need to code anything.

    As far as I understand, you want a multi-level navigation-property/navigation-connection based form structure, as in the following:

    Order -> Order Lines -> Products (add,delete vs.) -> Product details

    If I understood you properly, you can't update Product Details from the Order entity, instead you should update it through the product entity and so on.

    If you want a nested structure and the navigation properties that you defined are details of the related entity rather than independent unit, you may give a shot to ABP Suite's Master/Child Relationship support

    Please correct me, if I misunderstood you.

  • User Avatar
    0
    SuperBeastX3 created

    You understand it correctly, but I should have added one important detail. I don't really care about update with those connections, I am fine with updating the way it has been implemented today. I really only see a need from a display and reporting side. Imagine a screen where you want to view the Product Details (from your sample), but you always want to know the product category (up a level), and what order line it used (up a level again), and the order id (up a level again). If you had navigation connected all the way down, you'd be able to do that with one database call. I know a custom sql call can pull that together, but I'd like to see ABP suite get a little more polished for even quicker development. In our complex cases we use ABP Suite to generate the base code, but then heavily modify it to support our need.

    As for your link, I had not seen that yet. I also don't see the "Entty Type" selection in my version of ABP Suite. I am using V7.4.2. Why don't I see that?

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    You understand it correctly, but I should have added one important detail. I don't really care about update with those connections, I am fine with updating the way it has been implemented today. I really only see a need from a display and reporting side. Imagine a screen where you want to view the Product Details (from your sample), but you always want to know the product category (up a level), and what order line it used (up a level again), and the order id (up a level again). If you had navigation connected all the way down, you'd be able to do that with one database call. I know a custom sql call can pull that together, but I'd like to see ABP suite get a little more polished for even quicker development. In our complex cases we use ABP Suite to generate the base code, but then heavily modify it to support our need.

    I have taken note of this and will create a internal issue, so we can prioritize and work on it later on.

    As for your link, I had not seen that yet. I also don't see the "Entty Type" selection in my version of ABP Suite. I am using V7.4.2. Why don't I see that?

    The Master/Detail Relationship feature has been added with v8.0, this is why you are not seeing it as an option. If you want to use it, you should update the ABP CLI, ABP Suite and your project's version to v8.0 and then you can use the feature.

    Best regards.

  • User Avatar
    0
    SuperBeastX3 created

    Ah... I can't wait to try that out and see how it works. Thanks again. I close those out.

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