Export (0) Print
Expand All

SyndicationFeed.Items Property

Gets a collection of the feed items contained in the feed.

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

public IEnumerable<SyndicationItem> Items { get; set; }

Property Value

Type: System.Collections.Generic.IEnumerable<SyndicationItem>
A collection of SyndicationItem objects.

When serialized to Atom 1.0, the Items collection is written to <entry> elements.

When serialized to Atom 1.0, the Items collection is written to <item> elements.

The following code shows how to set the Items collection of a SyndicationFeed instance.


List<SyndicationItem> items = new List<SyndicationItem>();

SyndicationItem item1 = new SyndicationItem();
item1.Title = new TextSyndicationContent("Item 1");
item1.Content = SyndicationContent.CreatePlaintextContent("This is the content for Item 1");
items.Add(item1);

SyndicationItem item2 = new SyndicationItem();
item2.Title = new TextSyndicationContent("Item 2");
item2.Content = SyndicationContent.CreatePlaintextContent("This is the content for Item 2");
items.Add(item2);

SyndicationFeed feed = new SyndicationFeed();
feed.Items = items;


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


<entry>
  <id>ItemID</id>
  <title type="text">Item Title</title>
  <updated>2007-04-13T17:29:38Z</updated>
  <link rel="alternate" href="http://contoso/items" />
  <content type="text">Some text content</content>
</entry>


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


<item>
  <guid isPermaLink="false">ItemID</guid>
  <link>http://contoso/items</link>
  <title>Item Title</title>
  <description>Some text content</description>
  <a10:updated>2007-04-13T17:29:38Z</a10:updated>
</item>


.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.

Community Additions

ADD
Show:
© 2015 Microsoft