How to support OData /$count endpoint on functions
I am currently developing an OData web service with ASP.NET Core. I have a controller for companies and added an endpoint as an OData function to retrieve subsidiaries.
The subsidiaries should be displayed in a grid (I use DevExpress controls so I cannot directly influence the calls made by the control). The grid executes a call to the /$count endpoint (via a generated Microsoft.OData.Client), but this leads to a 404 error in the OData function. Is there a way to support the /$count endpoint, either by customizing the function or by using a separate method in my controller to route to this endpoint?
How to create odata and non-odata endpoint in same controller
Goal: Within the same controller create two httpget endpoints: one for OData and one for non-OData.