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
As an alternative, this can be accomplished with fluent api
.
builder.EntitySet<MyType>("MyType").EntityType.Expand(SelectExpandType.Automatic, "ExpandedField1", "ExpandedField2");
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.