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

Add support for @odata.count #57

Open
focus-craig opened this issue Dec 12, 2024 · 0 comments
Open

Add support for @odata.count #57

focus-craig opened this issue Dec 12, 2024 · 0 comments

Comments

@focus-craig
Copy link

It looks like when you call the ODATA endpoint and provide $count=true it will return a "@odata.count" property with the full count of the items.
This is useful if you are using paging and want to return only the top 10 but want to know the total number of search results.

In the Acumatica.RESTCLient.ODataApi project there is a class called ODataObject.cs.

I propose adding a count property to this class to get out this value.
[DataMember(Name = "odata.count", EmitDefaultValue = false)] public int? Count;

The ApiClientExtensions class will also need updated to be able to return this value.

Maybe new methods for returning results with a count.

public static (IEnumerable<JObject> Results, int Count) GetODataWithCount(...)

These methods would then apply the $count=true and return a count with the results?

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