AutoQueryable icon indicating copy to clipboard operation
AutoQueryable copied to clipboard

Send X-Total-Count header

Open henkosch opened this issue 6 years ago • 1 comments

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.

henkosch avatar Apr 04 '18 11:04 henkosch

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 ;)

trenoncourt avatar Aug 12 '18 18:08 trenoncourt