Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send X-Total-Count header #43

Open
henkosch opened this issue Apr 4, 2018 · 1 comment
Open

Send X-Total-Count header #43

henkosch opened this issue Apr 4, 2018 · 1 comment
Assignees

Comments

@henkosch
Copy link

henkosch commented Apr 4, 2018

It would be great to be able to optionally send an X-Total-Count header to show the total number of items in the collection instead of using wrapWith total-count.

@trenoncourt trenoncourt self-assigned this Apr 5, 2018
@trenoncourt
Copy link
Owner

hi @henkosch ,
Thanks for your patience

This feature could only work with filter version of AQ.
But AQ could be used without filters: .AutoQueryable(queryString)

I'll try to add this feature to AQ 2.2.x in a few weeks (2.1 will be focus on alias).

during this time you could use something like this:

dynamic t = queryable.AutoQueryable("...wrapwith=total-count");
setHeaders("X-Total-Count", t.TotalCount);
return new OkObjectResult(t.Result);

not tested ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants