SyndicationFeed.Categories Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets a collection of categories for the feed.

Namespace:   System.ServiceModel.Syndication
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

public Collection<SyndicationCategory> Categories { get; }

Property Value

Type: System.Collections.ObjectModel.Collection<SyndicationCategory>

A collection of SyndicationCategory objects that represent the categories for the feed.

When serialized to Atom 1.0, each SyndicationCategory in the collection is written to a <category> element.

When serialized to RSS 2.0, each SyndicationCategory in the collection is written to a <category> element.

The following code shows how to add a category to the Categories collection of a SyndicationFeed.

SyndicationFeed feed = new SyndicationFeed("Feed Title", "Feed Description", new Uri("http://Feed/Alternate/Link"), "FeedID", DateTime.Now);
feed.Categories.Add(new SyndicationCategory("MyFeedCategory"));

The following XML shows how the Categories collection is serialized to Atom 1.0.

<category term="FeedCategory" label="CategoryLabel" scheme="CategoryScheme" />

The following XML shows how the Categories collection is serialized to RSS 2.0.

<category domain="CategoryScheme">FeedCategory</category>

.NET Framework
Available since 3.5
Silverlight
Available since 2.0
Return to top
Show: