I'm writing a custom LINQ provider to a RESTful service. Some of the calls in the service return summary headers, including total number of records, pagesize, and the page of the return. I need clean a way to return this data. Given this query:
var foo = from x in ctx.MyQueryableThingie
select x;
The "foo" variable above becomes an IQueryable<MyQueryableThingie>
. What is the best way to return those summary data without attaching it to each member of the collection? I've considered making them properties of the Context, such the properties would be updated with each query, but I'm not sure that's the best pattern.