Open Closed

master-detail with existing database and UI #6474


User avatar
0
nabass created

hi sir, I have a big problem and i neeeeeeeeeeeeeed help as fast as can, I wish i can explain it now i made database and UI with tables one of these tables called (person) another called (partyAddress) these tables already exist and have UI already it works greate [partyAddress] table has no ID Type it just {AuditedAggregateRoot} as shown below and has 2 foriegn keys (partyId) form [party] table and (addressId) form [address] table so what kind of data in [partyAddress] table? like i mentioned there are relations between **address **and **partyAddress **when i store some data in address it stores in partyAdress like images below now i want to make a master-details between them using ABP Suite. I followed the tutorial but you make just existing table in database create ui from scratch no in my case UI already exist i want just master-detail between tables is there a way to make this showed in documentation or not? so please if you have a solution for this problem deal with me like i know nothing and tell me what should i do step by step thank you...

  • ABP Framework version: v8
  • UI Type: MVC
  • Database System: EF Core (SQL Server)

3 Answer(s)
  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Hi, in your code PartyAddress is a join entity (join-table in the database term) and its only responsibility is to establish many-to-many relationship between Party and Address entities. Therefore, I'm not sure it's a good candidate for a master-child relationship.

    In a master-child relationship, you would ideally have an entity and its data that can be considered as details of it. For example, you may have a customer entity and its contact information, in that scenario, you can define a master entity named Customer as a master entity and a Contact entity as a child entity and associate it with the master entity.

    So, the master and child entity should have a key to establish a relationship and that means the master entity should have a unique identifier (Id) and in your case, since the PartyAddress is the join entity, you can't create a master-child relationship with it.

  • User Avatar
    0
    nabass created

    that's mean that i should re-do the hole solution from scratch what if i already have a project running with UI and all is good but i want to make some relations and pages using ABP Suite?

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    that's mean that i should re-do the hole solution from scratch
    what if i already have a project running with UI and all is good but i want to make some relations and pages using ABP Suite?

    In the current structure of the master-child relationship of ABP Suite, yes you should re-configure these three entities.

    But if your only purpose is to show the parties and addresses in the row detail view, then you can create a separate solution, establish a master-child relationship with these entities, and apply the "row detail view" codes in your own application. This seems a better approach for you, with this approach, you'll just define some application service methods, and apply the UI changes.

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.2.0-preview. Updated on March 25, 2025, 11:10