New entity in m:n relation

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

hi I have m:n relation for CustomerEntity : RoleEntity. It is done through RelationCustomerRoleEntity.

Is there a way to assign new roles directly to the CustomerEntity? If I try to add them to CustomerEntity:Roles I will get InvalidOperationException thx

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 05-Jan-2011 10:16:17   
var newCustRole = new RelationCustomerRoleEntity();
newCustRole.Customer = myCustomer;
newCustRole.Role = myRole

;

pokrec
User
Posts: 20
Joined: 05-Jan-2011
# Posted on: 05-Jan-2011 10:23:03   

thx I was hoping I can skip this and based on m:n relation LLBLgen auto-magically will add middle entity