Hi
Let's say I have the following simple realtionship in a domain where a Customer holds a list of Orders, but the Order does not have a relationship back to Customer:
public class Customer : XPObject
{
public Customer() { }
public Customer(Session session) : base(session) { }
public XPCollection<Order> Orders
{
get { return GetCollection<Order>("Orders"); }
}
}
public class Order : XPObject
{
public Order() { }
public Order(Session session) : base(session) { }
private DateTime date;
public DateTime Date
{
get { return date; }
set { SetPropertyValue("Date", ref date, value); }
}
}
When I test this it raises a RequiredAttributeMissingException. But, if I add the [Association("Customer-Orders")] to Customer.Orders I get: "There is a malformed association 'Customer-Orders'. Cannot find the associated member for 'ObjectModel.UnmarkedCustomer.Orders' in the class 'ObjectModel.Order'".
Does XPO only support two-way associations when one side is a collection of persistent objects, or am I missing something?
Thanks
Sean