On Tue, 2010-03-02 at 13:58 -0800, [email protected] wrote:
> I am facing the same problem.
> 
> I was wondering how to use short lived DataContexts.

A short-lived data context is a context which is only declared within a
method, and not held within any class fields:

        class BAD {
                YourDataContext dataContext;
                // ...
        }
        
        class Good {
                void SomeMethod ()
                {
                        YourDataContext dataContext = CreateContext ();
                        // ...
                }
        }

This change will probably require larger changes to your code base, e.g.
methods would now need to take YourDataContext as a parameter instead of
implicitly referencing it, etc.

 - Jon


-- 
You received this message because you are subscribed to the Google Groups 
"DbLinq" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/dblinq?hl=en.

Reply via email to