Hello,
I have some problems with XPO object library.
I have a class Order and a class OrderItem. OrderItem has a reference to Order.
Simplified versions of these objects look like this:
public class Order : XPCustomObject
{
[Key(AutoGenerate = true)]
public Guid Oid
}
[DeferredDeletion(true)]
public class OrderItem : XPCustomObject
{
[Key(AutoGenerate = true)]
public Guid Oid
Order order;
[Association("Order_OrderItem", typeof(Order))]
public Order Order
{
get { return order; }
set { SetPropertyValue<Order>("Order", ref order, value); }
}
}
Once the objects are created and saved, the corresponding records in database tables occur as well.
If I set Order to the OrderItem, it's Oid shows in the table as a reference. That is still alright.
Then if I delete OrderItem with the reference to Order, the record stays in the database (as expected and with GCRecord set to not null), but the reference to Order disappears (column Order is null suddenly).
Later if i want to restore all the deleted OrderItems of an Order, I cannot do it, because there are none with the Order.Oid set in the Order column.
Can you please help me with deferred deletion not losing the references between objects?
Thank you in advance, Jan