New Posts New Posts RSS Feed: modelling many to many
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

modelling many to many

 Post Reply Post Reply
Author
hueha View Drop Down
Newbie
Newbie


Joined: 23-Jul-2010
Posts: 38
Post Options Post Options   Quote hueha Quote  Post ReplyReply Direct Link To This Post Topic: modelling many to many
    Posted: 01-Sep-2010 at 9:06am
Do you have an example of a many to many mapping where the mapping table has a payload? I found a sample but it was for devforce 2009.  
Basically I have 3 tables.  Locations, Contacts and a mapping table LocationContacts
LocationContacts has locationcontactid (identity) and 2 FK LocationID, ContactID
I am trying to add a Contacts property in Location.  I would like this contacts list to be updated if I add a new contact at that location.
The other problem I have is that the LocationContacts list that was added automatically by devforce is behaving strangely.  It is returning all the locationContacts but for some reason the contactid is coming back as 0 - detached.
 
Back to Top
sbelini View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 13-Aug-2010
Location: Oakland
Posts: 786
Post Options Post Options   Quote sbelini Quote  Post ReplyReply Direct Link To This Post Posted: 17-Sep-2010 at 8:35am
Hi,
 
 
Note that in the snippet the Create method is a static method on the Order partial class that you extend (you must write the code to handle the payload). In your .edmx model, right-click in the white area and select properties. Then, under DevForce Code Generation properties, set Generate Developer Classes to "True". This way entites partial classes will be automatically generated and you will be able to extend them.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down