SPC050228: Do not enable ObjectTracking in Linq.DataContext

If your code only queries lists, rather than adding, deleting, or editing list items, then you can turn off object change tracking. Doing so will improve performance. Set the ObjectTrackingEnabled property to false.

TypeName: DoNotEnableObjectTrackingInLinqDataContext
CheckId: SPC050228
Severity: Warning
Type: AssemblyFileReference
Resolution

Set the ObjectTrackingEnabled property to false.

using (DataContext teamSite = new DataContext(SPContext.Current.Web.Url))
{
   teamSite.ObjectTrackingEnabled = false;
   ...
}

Links

comments powered by Disqus