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)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online

public SPFeatureQueryResultCollection QueryFeatures(
	Guid featureId,
	bool needsUpgrade


Type: System.Guid

The value of the DefinitionId property of an SPFeature object. Only features that have this definition identifier are included.

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.