I have a Linq provider that successfully sends and receives data from my selected data source, but now I would like to do what I have a filtered result set, allows Linq to Objects to process the rest of the expression tree (for things like Joins, projection, etc.)
My thought was that I can simply replace the expression constant containing my IQueryProvider with the IEnumerable result sets via ExpressionVisitor and then return this new expression. Also return an IEnumerable provider from my IQueryable ... but this does not seem to work: - (
Any idea?
Edit: Some good answers here, but given the form ...
var qry = from c in MyProv.Table<Customer>() Join o in MyProv.Table<Order>() on c.OrderID equals o.ID select new { CustID = c.ID, OrderID = o.ID }
In my provider, I can easily return 2 result sets from clients and orders, if the data was from an SQL source, I would just build and pass the SQL Join syntax, but in this case the data is not from an SQL source, so I need to make a connection in the code. .. but, as I said, I have 2 sets of results, and Linq to Objects can make a connection ... (and later projection) it would be very nice to just replace the expression Constants MyProv.Table<Customer> and MyProv.Table<Order> with List<Customer> and List<Order> , and let the List<> provider handle the expression ... is this possible? as?
c # linq expression-trees iqueryable
Tim Jarvis Mar 30 '09 at 0:15 2009-03-30 00:15
source share