SPServiceContext.GetContext Method (SPSite)
Gets the service context for the specified SPSite object.
Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
Syntax
'Declaration
Public Shared Function GetContext ( _
site As SPSite _
) As SPServiceContext
'Usage
Dim site As SPSite
Dim returnValue As SPServiceContext
returnValue = SPServiceContext.GetContext(site)
public static SPServiceContext GetContext(
SPSite site
)
Parameters
site
Type: Microsoft.SharePoint.SPSiteSpecifies the site from which to retrieve the service context.
Return Value
Type: Microsoft.SharePoint.SPServiceContext
An SPServiceContext object for the specified site.
Remarks
If site is null, GetContext(SPSite) returns null.