This is rather a non-technical issue.
We intend to use OrganizationServiceContext with Linq instead of calling OrganizationServiceProxy.
My question is: what should be the lifetime of the context? Should it create an instance once per method or can you save it for the duration of the web application using a singleton approach?
What will be the pros / cons? Any tips?
Thanks in advance
You should never store a datacontext for the life of a web application. The application life cycle is managed outside of your code.
, . Datacontexts , .
, . concurrency, .
Gats, , , . Silverlight, , , , , , .