I'm trying to tack on additional information to the list of items returned from an ODataController
's method. The use case is summary rows. So we basically want to return the rows of the report and then also additional info with totals, sub-totals, etc.
So, basically starting with this method:
public PageResult<MyReportLine> Get(ODataQueryOptions odataQueryOptions)
I tried wrapping MyReportLine
in MyReport
public class MyReport {
IEnumerable<MyReportLine> _myReportLines;
MySummaryRow _mySummaryRow;
}
and then returning this MyReport
object.
public PageResult<MyReport> Get(ODataQueryOptions odataQueryOptions)
This approach seemed to mess up all the querying mechanisms because the query supplied in the URI was targeting MyReportLine
, but MyReport
is the actual class that's exposed. I don't think that the wrapper/summary should be a first-class entity...
Is there a recommended approach to this task?
You should use ODataQueryOptions i.e