TaxonomySession constructor (SPWeb, Boolean)

Creates a new session for performing taxonomy operations, using the specified SPWeb as the context for security permissions.

Namespace:  Microsoft.SharePoint.Taxonomy
Assembly:  Microsoft.SharePoint.Taxonomy (in Microsoft.SharePoint.Taxonomy.dll)

Syntax

'Declaration
Public Sub New ( _
    webForPermissions As SPWeb, _
    updateCache As Boolean _
)
'Usage
Dim webForPermissions As SPWeb
Dim updateCache As Boolean

Dim instance As New TaxonomySession(webForPermissions, _
    updateCache)
public TaxonomySession(
    SPWeb webForPermissions,
    bool updateCache
)

Parameters

  • webForPermissions
    Type: Microsoft.SharePoint.SPWeb

    The SPWeb object that provides the access control list (ACL) for the site collection group security permissions.

  • updateCache
    Type: System.Boolean

    A 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 SPWeb 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.

See TaxonomySession(SPSite, Boolean) for more information about the overloaded constructor.

See also

Reference

TaxonomySession class

TaxonomySession members

TaxonomySession overload

Microsoft.SharePoint.Taxonomy namespace

TaxonomySession