Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

SPServiceContextScope Class

Creates a block within which an SPServiceContext object is in scope.

System.Object
  Microsoft.SharePoint.SPServiceContextScope

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
public sealed class SPServiceContextScope : IDisposable

The block is limited to the thread on which the object is created.

The object must be created and disposed on the same thread. Multiple objects of this type can be created on a thread, but they must be disposed in a LIFO manner. Specifically, if scopes are created in order (1,2,3,4,5), they must be disposed in the opposite order (5,4,3,2,1). Failure to do so causes an exception to be thrown.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.