Without going into it, a good or bad idea:
Is it possible to save a LINQ-to-SQL domain object in an ASP.NET session when the session is down?
[EDIT] I am currently getting the following error and asked this question because I suspect LINQ-to-SQL objects:
Unable to serialize session state. In StateServer and SQLServer mode, ASP.NET will serialize session state objects, and as a result, non-serialization objects or MarshalByRef objects are not allowed. The same restriction applies if similar serialization is performed in the user session state store in the "User" mode. [/ EDIT]
eg.
Session["Zoo"] = new Zoo() { new Lion(), new Tiger(), new Elephant() }
Where:
- Zoo, Lion, Tiger, Elephant all from ZooDataContext
and the web.config file contains
<sessionState mode="StateServer" stateConnectionString="tcpip=127.0.0.1:42424" stateNetworkTimeout="10" sqlConnectionString="SqlStateConnectionString" sqlCommandTimeout="30" timeout="20" regenerateExpiredSessionId="true"/>
source share