Id (int, primary key)
Name (string)
PartyId (int)
I want to create a one-to-many association with another class "Port". It has a property "PartyId" that indicates which ContractPartner it belongs to.
So I've created an association with ContractPartner as the parent class and Port as the child class, and I've chosen "PartyId" as both the parent and child property to use.
But when I run my program the relation is matched on "Id" on the parent class instead of "PartyId".
If I look in the generated code, the attributes for the association looks like this:
Code: Select all
[Association(Name="ContractPartner_Port", Storage="_ContractPartner", ThisKey="PartyId", IsForeignKey=true)]
Code: Select all
[Association(Name="ContractPartner_Port", Storage="_ContractPartner", ThisKey="PartyId", OtherKey="PartyId")]