Does the Asp.net Web API 2.2 OData4 group support the group?

Does Asp.net Web API 2.2 OData4 support aggregation and groupby clause? I could not find a definitive answer to this question.

+4
source share
1 answer

An alternative is to implement your service using the QueryByCubelinq extension method provided by the AdaptiveLINQ component .

For instance:

[EnableQuery]
public IQueryable<SalesCubeItem> Get()
{
     return DataContext.OrderDetails.QueryByCube(new SalesCubeDefinition());
}

where to SalesCubeDefinitiondetermine:

  • 2 measurements: ProductNameandCustomerName
  • 2 measures: Sales,Quantity

You can request sales per customer using the OData protocol as follows:

http://.../salesAnalysis?$select=CustomerName,Sales

, :

http://.../salesAnalysis?$select=ProductName,Quantity

, , OData ($ filter, $orderby...)

: AdaptiveLINQ

+2

All Articles