我的项目中有一些XPObject。我已经写了三本。产品是父级,Roll和Bale扩展了。
public class Product : XPObject
{
...
private Box _box;
[Association]
public Box Box
{
get => _box;
set => SetPropertyValue("Box", ref _box, value);
}
}
[MapInheritance(MapInheritanceType.OwnTable)]
public class Bale : Product
{
...
}
[MapInheritance(MapInheritanceType.OwnTable)]
public class Roll: Product
{
...
}
产品类别中有与Box的关联。在我的代码的一部分中,我需要访问box.Bale产品。只是罢了。我需要它们作为XPCollection用于网格的数据源。 我该怎么办?