Question about LINQ
Posted: Wed 26 Aug 2009 14:59
Hello all,
I have a situation and i want your help.
I use LINQ to query some tables where one of them is "CUSTOMERS". I join with other tables and i create the final query incrementally according to the fields provided by the user (last name, first name etc.). The final IQueryable is passed to a special grid (Dev Express). The grid uses the IQueryable to do automatic Server-side processing, retrieving records a few at a time as the User scrolls down the relevant scrollbar.
Everything works ok. But...
I need to dynamically change the "CUSTOMERS" table with a View which brings a subset of the Customers table and which is custom defined by the user. The name of the view is stored in a table in the database.
Therefore, i cannot have a direct implementation of the view as a method on my datacontext.
I cannot use the ExecuteQuery method because this actually executes the query and results in an IEnumerable. I can't use that as a feed to my grid, because it expects an IQueryable in order to do its thing.
Im stuck... I just want to change the resulted table name and i don;t have a way to do it!!
Can anyone help?
I have a situation and i want your help.
I use LINQ to query some tables where one of them is "CUSTOMERS". I join with other tables and i create the final query incrementally according to the fields provided by the user (last name, first name etc.). The final IQueryable is passed to a special grid (Dev Express). The grid uses the IQueryable to do automatic Server-side processing, retrieving records a few at a time as the User scrolls down the relevant scrollbar.
Everything works ok. But...
I need to dynamically change the "CUSTOMERS" table with a View which brings a subset of the Customers table and which is custom defined by the user. The name of the view is stored in a table in the database.
Therefore, i cannot have a direct implementation of the view as a method on my datacontext.
I cannot use the ExecuteQuery method because this actually executes the query and results in an IEnumerable. I can't use that as a feed to my grid, because it expects an IQueryable in order to do its thing.
Im stuck... I just want to change the resulted table name and i don;t have a way to do it!!
Can anyone help?