TaxonomySession constructor (SPList, Boolean)
Creates a new session for performing taxonomy operations, using the specified SPList as the context for security permissions.
Namespace: Microsoft.SharePoint.Taxonomy
Assembly: Microsoft.SharePoint.Taxonomy (in Microsoft.SharePoint.Taxonomy.dll)
Syntax
'Declaration
Public Sub New ( _
listForPermissions As SPList, _
updateCache As Boolean _
)
'Usage
Dim listForPermissions As SPList
Dim updateCache As Boolean
Dim instance As New TaxonomySession(listForPermissions, _
updateCache)
public TaxonomySession(
SPList listForPermissions,
bool updateCache
)
Parameters
listForPermissions
Type: Microsoft.SharePoint.SPListThe SPList object that provides the access control list (ACL) for the site collection group security permissions.
updateCache
Type: System.BooleanA Boolean value specifying whether the taxonomy cache should be updated immediately. true if the cache should be immediately updated; otherwise false.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | The listForPermissions parameter should not be a null reference (Nothing in Visual Basic). |
Remarks
The TaxonomySession object is the starting point for all operations involving objects from the taxonomy. It provides access to one or more TermStore objects, (for example, managed metadata connections), where the Microsoft.SharePoint.Taxonomy.Group, TermSet, and Microsoft.SharePoint.Taxonomy.Term objects reside.
Setting the updateCache parameter to true is equivalent to calling the UpdateCache() method, and causes the taxonomy cache to be updated immediately. This is normally unnecessary and may harm performance; it is mainly used immediately before performing a change, to reduce the likelihood of save conflict errors.
The site collection group is a special taxonomy group that is associated with a specific SPSite. It is automatically editable by any user with ManageLists permissions on any SPList or SPWeb in the site collection, but for performance reasons these permissions are only honored in contexts where the caller has already opened the object. The SPList and its associated SPWeb will be checked for permissions.
See TaxonomySession(SPSite, Boolean) for more information about the overloaded constructor.