2

I am trying to issue aggregate queries to my oData server, but i get errors, dispute having the exact same code as in documentation

var product = await client
            .For("People")
            .Filter("FirstName ne 'Joni'")
            .Count()
            .FindScalarAsync();

Code in documentation

var x = ODataFilter.Expression;
        var count = await _client
            .For("Products")
            .Filter("ProductName+eq+%27Chai%27")
            .Count()
            .FindScalarAsync();
        Assert.Equal(1, count);

From: https://github.com/object/Simple.OData.Client/wiki/Retrieving-data-matching-search-criteria

In this same case, why are they declaring "x"? It is never used.

Also, how would i go about accessing functions like Min/Max that are defined here:

http://docs.oasis-open.org/odata/odata-data-aggregation-ext/v4.0/cs01/odata-data-aggregation-ext-v4.0-cs01.pdf

user2824991
  • 41
  • 1
  • 8
  • what error did you get ? – Disappointed Aug 05 '15 at 19:51
  • .FindScalarAsync() is red. Type argument cant be inherited for usage. Try specifying the type explicitly. I did look at the API, and the method defined is "Task FindScalarAsync();" I tried using various data forms for , but i always get bad request – user2824991 Aug 05 '15 at 20:03
  • Could it be related to the code in documentation using URL escaped string, your code does not? – Marvin Smit Aug 06 '15 at 11:51

2 Answers2

0

Never mind, Aggregate queries are not supported yet

Source: https://github.com/object/Simple.OData.Client/issues/76

user2824991
  • 41
  • 1
  • 8
0

I developed the AdaptiveLINQ component which introduces the concept of cube in a LINQ query (on any LINQ provider supporting GroupBy).

This allows to perform a server-side aggregation simply by specifying a $select query.

Example:

SalesView?$select=CustomerName,Sales

assuming SalesView is defined by a cube with the dimension CustomerName and the measure Sales.

nlips
  • 1,258
  • 9
  • 25