0 out of 1 rated this helpful - Rate this topic

SyndicationFeed.Categories Property

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

Supported in: 4, 3.5

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ