Question

I know I can use ESQL to query an ObjectSet of T but can I use it to query an arbitrary IQueryable of T?

EDIT

Example:

var originalQuery = from t in Transactions where t.Date < DateTime.Now select t;

// query is now an IQueryable<Transation>. Now I want to do some dynamic manipulations
// on originalQuery by using ESQL

var manipulationQuery = "select t.a as A from T as t";

// I want to execute manipulationQuery over the originalQuery, something like this:
// (this is a hipotetical method. It does not exist)
var transactions = context.RunESQLOverIQueryable(originalQuery, manipulationQuery).ToList();

EDIT 2

Actually the use case is the following: I need a programmer to code a method that returns an IQueryable(T) representing the core query. This query will be given to a ReportControl that must execute a series of group bys on this query, as well as selecting which columns must be retrieved and so forth. I thought that manipulating the core query dynamically through ESQL is a good choice. I'm not sure either.

Was it helpful?

Solution

Check Dynamic Linq library. It is part of samples for Visual studio 2008 but it will work with 2010 as well.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top