Search code examples
.netlinqsession-state

Serializing IQueryable<T> to session state server


How can I store a LINQ query (i.e. of type IQueryable<T>) in SQL Server session state or any other State Server?


Solution

  • 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