I have something like this:
public class Person {
string Name;
}
public class Customer : Person {
List<Order> orders;
}
public class MyReference {
Person aPerson;
}
public class Me {
MyReference myRef;
}
Now in my Metamodel I have specified a baseType for Customer. And I think my metamodel is right. The only problem is, that when I want to execute a query like the following:
breeze.EntityQuery.from('Me').expand('myRef, myRef.aPerson, myRef.aPerson.orders')
I get an error, that "orders" is not allowed on the EntityType "Person". Of course as it's the base-class. I would like it to be polymorphic and if the Person is really of Type "Customer" it should expand orders and if not, well then it can be empty or not defined or not even existent on the object.
Is this somehow possible? Would I need some kind of "toType" to cast inside the Query?