How to apply MaxExpansionDepth globally or to an entire controller in breeze
Asked Answered
A

2

0

I found this SO answer: MaxExpansionDepth with latest webapi and breeze

But this only applies to a single method on the controller. Applying the BreezeQueryable attribute to the controller itself breaks the entire controller at runtime with this exception: Token PropertyName in state ArrayStart would result in an invalid JSON object. Path ''.

This is presumably because not all of the methods on my (large) breeze controller return IQueryable.

So, how do I change MaxExpansionDepth for my entire breeze controller? The BreezeControllerAttribute seems to accept all of the BreezeQueryableAttribute parameters EXCEPT MaxExpansionDepth.

Thanks, Mathias

Ambrosio answered 7/2, 2014 at 18:41 Comment(0)
S
0

We can look into offering the Web API Queryable attributes on the BreezeControllerAttribute and applying your settings as the default values when we qualify the controller query methods. Please vote for this on "User Voice"

Meanwhile, you know it is open source. You can implement your own version of BreezeControllerAttribute.

Spermaceti answered 9/2, 2014 at 6:17 Comment(0)
T
0

I submitted a pull request to add the MaxExpansionDepth to a controller rather than on each methods. https://github.com/IdeaBlade/Breeze/pull/35

Tennison answered 11/2, 2014 at 15:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.