SyndicationFeed Constructor (IEnumerable<SyndicationItem>)


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

Initializes a new instance of the SyndicationFeed class with the specified collection of SyndicationItem objects.

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

public SyndicationFeed(
	IEnumerable<SyndicationItem> items


Type: System.Collections.Generic.IEnumerable<SyndicationItem>

A collection of SyndicationItem objects.

The collection of SyndicationItem objects passed into this constructor is buffered.

The following example demonstrates how to call this constructor.

List<SyndicationItem> items = new List<SyndicationItem>();
SyndicationItem item1 = new SyndicationItem();
item1.Title = new TextSyndicationContent("Item 1");
item1.Summary = new TextSyndicationContent("This is Item 1's summary");
item1.Authors.Add(new SyndicationPerson("", "Jesper Aaberg", "http://contoso/jesper"));
item1.Content = SyndicationContent.CreatePlaintextContent("This is the content for Item 1");

SyndicationItem item2 = new SyndicationItem();
item2.Title = new TextSyndicationContent("Item 2");
item2.Summary = new TextSyndicationContent("This is Item 2's summary");
item2.Authors.Add(new SyndicationPerson("", "Lene Aaling", "http://contoso/lene"));
item2.Content = SyndicationContent.CreatePlaintextContent("This is the content for Item 2");

SyndicationFeed feed = new SyndicationFeed(items);

.NET Framework
Available since 3.5
Available since 2.0
Return to top