Odata expand query result by default

前端 未结 2 1477
陌清茗
陌清茗 2021-01-22 11:29

Is there a way to auto expand nested entity in the response with odata 5.7?

Because by default we have to add ?$expand=myNestedEntity

2条回答
  •  无人共我
    2021-01-22 12:02

    In your entity class definition, use the AutoExpand attribute on the navigation properties you would like to have expanded.

    Namespace: Microsoft.AspNet.OData.Builder

    Represents an Attribute that can be placed on a navigation property to specify it is auto expanded, or placed on a class to specify all navigation properties are auto expanded.

提交回复
热议问题