简体   繁体   中英

OData V3: how to query derived type when it is stored in a parent table?

I have the following class structure:

abstract class Person {}
class Employee : Person {}
class Customer : Person {}

I use some ORMapper (XPO in my case) to store the data in the database in that way the Employee and Customer types are stored in the base "Person" database table.

Then I create an OData V3 web service by using DevExpress Odata provider from DevExpress (and they state that it provides full odata-v3 functionality). So probably it is only the OData related issue.

Now as my derived types are stored in the parent table, in the odata web service project the corresponding types are not autogenerated. So I am unable to query them by using "isof" function (or I am missing something):

http://localhost:51451/ODataService1.svc/Person?$filter=isof('ODataService1.TestOdata.Employee')&$format=json

How should I query only the objects of the selected derived type (eg Employee) if it is stored in the parent table?

Any clues that might help a little?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM