How can I store a LINQ query (i.e. of type IQueryable<T>) in SQL Server session state or any other State Server?
You can't serialize the IQueryable but you may be able to serialize the expression tree which generates that IQueryable. Check out the following question and associated MSDN link.
Can you Pass Func<T,bool> Through a WCF Service?
http://archive.msdn.microsoft.com/exprserialization
You can serialize/deserialize manually the Expression that is associated to IQueriable using the visitor
Or check here: http://archive.msdn.microsoft.com/exprserialization
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With