0

I have an entity like so

public class Permission
{
     IEnumerable<Permission> Children {get;set;}
}

How to specify an expand query that goes as deep as is needed, currently i am using

public IEnumerable<IManagePermission> GetRootPermissions()
        {
            return this.adminService.ManagePermissionViews.Expand("Children/Children/Children/Children").Where(item=>item.ParentPermissionId  == null);
        }

But this is sucky as i have no idea really how deep the permissions may be nested, i considered calling another query to find this out first then using this value to construct the nested argument.

But again .. sucky..

4

1 回答 1

0

There's no way in OData protocol currently to request behavior like that. The best solution would probably be to load these on demand using separate requests.

于 2012-05-29T15:33:36.220 回答