Filter on Expanded entities in OData

后端 未结 3 1647
臣服心动
臣服心动 2021-01-14 14:03

How to apply filtering conditions on expanded entities in OData ?

Suppose I have master entity as home having fields

homeId, StateId, C         


        
3条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-14 14:47

    I suspect your home entity type doesn't actually have navigation properties on it. In OData, if you want to connect two entities, you would create a property whose type matches the entity you want to link to. These properties (i.e., properties whose type is an entity type) are called navigation properties. If you want home to have an associated state, your home type would have a property called "State" or something like that, and that property would be of type state. Think of object-oriented programming instead of join-able IDs you would use in a relational database.

    Similarly, home should have a property with type county if you want to connect a home entity to a county entity. Once you have navigation properties called "state" and "county", eoghank's answer should work for you.

提交回复
热议问题