m:n relations and add

Posts   
 
    
pokrec
User
Posts: 20
Joined: 05-Jan-2011
# Posted on: 20-Jan-2011 12:09:06   

var newCustRole = new RelationCustomerRoleEntity(); newCustRole.Customer = myCustomer; newCustRole.Role = myRole

after I execute this code Customer:RelationCustomerRoleEntity 1:n and Role:RelationCustomerRoleEntity 1:n both have their collections for roles and customers updated but Customer:Role m:n is intact - it does not see the changes

is this normal? if yes then what is teh puropse of this collection if it is not updated same as 1:n relations ?

I am using LLBGen 2.6 with .NET 3.5

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 20-Jan-2011 22:16:02   

This is by design. Please look at the section in the documentation under "How do I add an entity A to an entity B's collection of A's if A and B have an m:n relation ?" in the tutorials section for an explanation.

Matt

pokrec
User
Posts: 20
Joined: 05-Jan-2011
# Posted on: 23-Jan-2011 13:13:58   

thx, I've found it though it would be a nice feature if it was possible to work with m:n relations with middle entity hidden from the programmer