Feature class

Represents an activated feature.

Inheritance hierarchy

System.Object
  Microsoft.SharePoint.Client.ClientObject
    Microsoft.SharePoint.Client.Feature

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

Syntax

'Declaration
Public NotInheritable Class Feature _
    Inherits ClientObject
'Usage
Dim instance As Feature
public sealed class Feature : ClientObject

Examples

This code example displays the identifiers of the current website’s active features.

using System;
using Microsoft.SharePoint.Client;

namespace Microsoft.SDK.SharePointFoundation.Samples
{
    class FeatureExample
    {
        static void Main()
        {

            string siteUrl = "http://MyServer/sites/MySiteCollection";

            ClientContext clientContext = new ClientContext(siteUrl);
            Web site = clientContext.Web;
            FeatureCollection collFeature = site.Features;

            clientContext.Load(collFeature);
            clientContext.ExecuteQuery();

            foreach (Feature oneFeature in collFeature)
               Console.WriteLine("Feature ID: {0}", oneFeature.DefinitionId);
        }

    }
}

Thread safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See also

Reference

Feature members

Microsoft.SharePoint.Client namespace