TaxonomySession constructor (SPSite, Boolean)

Initializes a new instance of a TaxonomySession object that is scoped to a specific SPSite object.

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

Syntax

'Declaration
Public Sub New ( _
    site As SPSite, _
    updateCache As Boolean _
)
'Usage
Dim site As SPSite
Dim updateCache As Boolean

Dim instance As New TaxonomySession(site, updateCache)
public TaxonomySession(
    SPSite site,
    bool updateCache
)

Parameters

  • site
    Type: Microsoft.SharePoint.SPSite

    An SPSite object which provides the user identity for security permissions, and which determines the site collection group from the term store.

  • 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 site 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 likelyhood 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.

In multi-tenant environments, the provided SPSite object also determines the tenant service partition for the Managed Metadata Service connections.

See also

Reference

TaxonomySession class

TaxonomySession members

TaxonomySession overload

Microsoft.SharePoint.Taxonomy namespace