Proposed Solution:
Either support n:m associations with a hidden implicit link table (similarly to XPO), or support creating database indexes (IndexedAttribute) to allow explicit link table creation. Hope this approach will be supported in UI (SystemModules.Link - Support Many-To-Many associations created via an intermediate link class).
DC - Support many-to-many associations between domain components
Answers
Starting from version 11.1.3 you can use the following code, to define a M-M relationship between two domain components:
C#[DomainComponent]
public interface ITestManyToMany1 {
String Name { get; set; }
IList<ITestManyToMany2> List { get; }
}
[DomainComponent]
public interface ITestManyToMany2 {
String Name { get; set; }
IList<ITestManyToMany1> List { get; }
}
Thanks,
Dennis
We decided not to implement implicit many-to-many relations in Domain Components. To create a many-to-many relation you must explicitly create an intermediate class (interface), and define two one-to-many relations.
This scenario will be supported in XAF when the following suggestions are implemented:
SystemModules.Link - Support Many-To-Many associations created via an intermediate link class,
DC - Provide an analog of the XPO's IndexedAttribute.
We have changed our decision and are going to implement the built-in many-to-many relationship support in DC.