NOTE: Starting with v22.1.4, you can no longer select the DevExpress ORM OData v3 Service project template in Visual Studio. This project template itself and WCF Data Services 5.0 (OData v3) are outdated. OData v4 is the most recent standard that provides much more features than OData v3 (learn more).
Use the Web API Service with integrated authorization & CRUD operations based on ASP.NET Core OData 8.0 (OData v4) powered by EF Core and XPO ORM library instead. For more information, see XPO - The DevExpress ORM OData v3 Service project template has been removed from the Template Gallery.
Description:
I created an XPO OData service (XpoDataServiceV3) based on my model, but when I try to query a collection of objects that are derived from another persistent object, the result set includes all objects inherited from the base class. Is it a bug? How can I get only derived objects?
Answer:
This behavior is caused by limited support for derived objects in the OData protocol, which doesn't expose derived classes as entity sets. To access derived objects or their properties, you have to include a type cast using the qualified object type name in the path constructed for a base class. For example, if you wish to get Person objects that are inherited from Party, use the following query:
http://localhost:56789/MyDataService.svc/Party/Person/
Please refer to Derived Entity Type section of the OData Advanced Tutorial and Addressing Derived Types section of the OData protocol documentation for more examples.
Note that this specificity is not related to XPO. If you create a WCF Data Service based on an Entity Framework model, it will behave in a similar manner in regard to derived entities.