For testing purposes I'm querying the term 'test' within a table on several columns. The filter url generated looks like this:
$filter=(substringof('test',Column1) eq true)) and (substringof('test',Column2) eq true)) and (substringof('test',Column3) eq true)) ...
The query works fine until the number of columns queried exceeds 15. At this point I get the following error message:
Query failed: The node count limit of '100' has been exceeded. To increase the limit, set the 'MaxNodeCount' property on QueryableAttribute or ODataValidationSettings.
I got around it by adding the following attribute to the api method being called:
[Queryable(
AllowedQueryOptions = AllowedQueryOptions.All,
AllowedFunctions = AllowedFunctions.AllFunctions,
MaxNodeCount = 200)]
But this does not seem to play well with foreign entities. They are always null when using the expand function. I checked the resulting filter url and it does include the necessary $expand syntax.
Is there anything else I'm missing?
update your controller method with this attribute:
[EnableBreezeQuery( MaxNodeCount = 200)]
Are you sure $expand works when there is no MaxNodeCount set?
If you use WebAPI, $expand won't do anything for you, you will have response from server like:
SelectedSubItem=null
Instead, try going into your model and instead of returning
return Context.MyClass;
do this:
return Context.MyClass.Include("SelectedSubItem");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With