Sitefinity overwriting HttpContext.Current.Items
I am using Entity Framework for my Custom MembershipProvider, and I like to attach my DataContext to a User Session when possible as per the West Wind article below but Sitefinity is consistently overwriting HttpContext.Current.Items. Do you have any ideas on why this may be? anything I may do to prevent it? or know of another constantly present object where I may be able to store the DataContext? Once I do finally catch a debug turn where my DataContext is still in HttpContext.Current.Items I get the error "The ObjectContext instance has been disposed and can no longer be used for operations that require a connection." www.west-wind.com/.../Linq-to-SQL-DataContext-Lifetime-Management
Interesting question, we would like to store some of our repositories in http context to cut down on database trips, so we'll be faced with a similar problem.
Hi Viktor and Joseph,
Our custom HTTP handler disposes the .Items collection at the end of the request. You could use the Session object instead. I'm not sure how exactly do you use the Context.Items collection in your case, so code would help.
Greetings,