Closed buchatsky closed 2 years ago
Thanks for reporting this. We'll take a look.
Pretty sure this is because you are missing skip or take. No point to have an inline count if you are returning the entire resultset. Just count the returned entities. I'm using inlineCount in my current project and it's returning the count just fine, but I have at least a take.
This works fine for pagination:
entityQuery
.skip(currentPage.pageIndex * (currentPage.pageSize || pageSize))
.take(currentPage.pageSize || pageSize)
.inlineCount(),
and this works fine if you just wanna count the records, but not actually returning them:
entityQuery.take(0).inlineCount()
@marcelgood I agree with you, thank you. So, it's a feature, not a bug
Requests to the Web API controller (derived from ControllerBase) with [BreezeQueryFilter] and with the single {"inlineCount":true} option in QueryString always return a plain data array without a surrounding Breeze context:
Requests with inlineCount used along with any other QueryFilter option work as expected and return the correct Breeze context (with its Results set to data array and InlineCount set to correct count):
.Net 5 Breeze.AspNetCore.NetCore: 5.0.5