Edit

Share via


MaxExpansionDepth in EnableQueryAttribute

Applies To:# OData WebApi v7 for aspnet webapi supported Green circle with a checkmark inside it. OData AspNet WebApi V7# OData Webapi for Webapi supported Green circular checkmark icon to indicate a success. OData AspNet WebApi V6

Since Web API OData V5.9.1, it corrected the behavior of MaxExpansionDepth of EnableQueryAttribute. MaxExpansionDepth means the max expansion depth for the $expand query option.

When MaxExpansionDepth value is 0, it means the check is disabled, but if you use $level=max at the same time, the expand depth will be a default value : 2, to avoid the dead loop.

Let's see some samples about this behavior.

$expand=Manager($levels=max) will be the same as $expand=Manager($expand=Manager)

$expand=Manager($levels=3) will be the same as $expand=Manager($expand=Manager($expand=Manager))

Related Issue #731.