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

How can I return the total count with the EdmEntityObjectCollection for paging? #127

Open
rogerskk opened this issue Feb 22, 2020 · 0 comments

Comments

@rogerskk
Copy link

I'm using the DynamicEdmModelCreation sample and I've generated my EdmModel from a database query because what I'm working on has to support multiple client databases and some have custom fields so not every table will be the same.

I want to be able to do paging and have manually added the top and skip to my query getting the query options as follows:
var model = EdmModelHelper.EdmModel;
IEdmEntityType entityType = model.SchemaElements.OfType().First(c => c.Name == "Products");

        ODataQueryContext queryContext = new ODataQueryContext(model, entityType, path);
        ODataQueryOptions queryOptions = new ODataQueryOptions(queryContext, Request);

queryOptions.Count is read only. I'm not seeing how I can return the total count, even if I add $count=true in the url.

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

No branches or pull requests

1 participant