Skip to content

Add support for @odata.count #57

@focus-craig

Description

@focus-craig

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions