I'm experimenting with XPO and attempting to wrapper some existing tables. Does anyone have experience with doing this? The problem I'm running into is determining how XPO determines the names of the linking fields for relationships.
For example, I have two tables,
Merchant( MerchantID, ProcessorID, etc...) linking 1 to 1 with Processor
Processor( ProcessorID, etc...) linking 1 to Many with Merchant
DevExpress says to set up the relationship as follows:
public class Merchant : XPLiteObject
{
[Association("Processor-Merchants")]
public Processor Processor;
}
public class Processor : XPLiteObject
{
[Association("Processor-Merchants", typeof(Merchant))]
public XPCollection Merchants {
get { return GetCollection("Merchants"); }
}
}
But my question is, how is XPO going to know which are the key fields linking these relationships together? This example compiles and runs in an XAP application, but the data is missing for each relationship (probably due to the fact it doesn't know which fields are linking the tables together).
Is there syntax I'm missing that I need to add to establish these relations? Or, maybe some extra code needed? The DevExpress documents say the above should work, but it doesn't.
Any help?