Thursday, September 29, 2011

When to use "using" (when to dispose) on SharePoint

Roger Lamb's dispose patterns.

Good one to remember about SPContext:
"SPContext.Current.Site & SPContext.Site as well as SPContext.Current.Web & SPContext.Web properties return SPSite and SPWeb objects respectively that DO NOT need a call to Dispose() and will be disposed automatically by SharePoint."

No comments:

Post a Comment