SPSite.QueryFeatures method (Guid, Boolean)

Gets a collection of the features deployed in this site collection that have a specific definition identifier, including only features that either do or do not need to be upgraded.

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

Syntax

'Declaration
Public Function QueryFeatures ( _
    featureId As Guid, _
    needsUpgrade As Boolean _
) As SPFeatureQueryResultCollection
'Usage
Dim instance As SPSite
Dim featureId As Guid
Dim needsUpgrade As Boolean
Dim returnValue As SPFeatureQueryResultCollection

returnValue = instance.QueryFeatures(featureId, _
    needsUpgrade)
public SPFeatureQueryResultCollection QueryFeatures(
    Guid featureId,
    bool needsUpgrade
)

Parameters

  • needsUpgrade
    Type: System.Boolean

    If true, only features that need to be upgraded are included. If false, only features that do not need to be upgraded are included.

Return value

Type: Microsoft.SharePoint.SPFeatureQueryResultCollection
An enumerable collection of SPFeature objects.

See also

Reference

SPSite class

SPSite members

QueryFeatures overload

Microsoft.SharePoint namespace