Export (0) Print
Expand All

SyndicationFeed.Authors Property

Gets a collection of authors of the feed.

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

public Collection<SyndicationPerson> Authors { get; }

Property Value

Type: System.Collections.ObjectModel.Collection<SyndicationPerson>
A collection of SyndicationPerson objects that represents the authors of the feed.

When serialized to Atom 1.0, each SyndicationPerson in the collection is written to an <author> element. When serialized to RSS 2.0, if only a single SyndicationPerson exists in the collection, it is written to a <managingEditor> element. Otherwise, each SyndicationPerson is written to an <a10:author> element.

The following code shows how to add an author to the Authors collection of a SyndicationFeed.

SyndicationFeed feed = new SyndicationFeed("Feed Title", "Feed Description", new Uri("http://Feed/Alternate/Link"), "FeedID", DateTime.Now);
feed.Authors.Add(new SyndicationPerson("jesper@contoso.com", "Jesper Aaberg", "http://contoso/jesper"));           

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

<author>
  <name>Jesper Aaberg</name>
  <uri>http://contoso/Aaberg</uri>
  <email>Jesper.Asberg@contoso.com</email>
</author>

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

<a10:author>
  <a10:name>Lene Aalling</a10:name>
  <a10:uri>http://contoso/Aalling</a10:uri>
  <a10:email>Lene.Aalling@contoso.com</a10:email>
</a10:author>

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft