SyndicationPerson.Uri 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 and sets the URI of the SyndicationPerson.

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

public string Uri { get; set; }

Property Value

Type: System.String

The URI of the person's Web site.

When serialized to Atom 1.0, the Uri property is written as a <uri> element. The <uri> element appears within an <author> or <contributor> element, which depends upon which collection (authors or contributors) the SyndicationPerson is added to.

When serialized to RSS 2.0, the Uri property is written as an <a10:uri> element. The <a10:uri> element appears within a <managingEditor>, <a10:author>, or <a10:contributor> element. If only one SyndicationPerson is added to the authors collection, the <a10:uri> element is written within the <managingEditor> element. If more than one SyndicationPerson is added to the authors collection, the <a10:uri> element is written within the <a10:author> element. If the SyndicationPerson is added to the contributors collection, the <a10:uri> element is written within the <a10:contributor> element.

The following code shows how to set the URI for a SyndicationPerson instance.

SyndicationPerson sp = new SyndicationPerson();
sp.Uri = "http://Jesper/Aaberg";

The following XML shows how the Name is serialized for Atom 1.0.

<author>
  <name>Jesper Aaberg</name>
  <uri>http://Jesper/Aaberg</uri>
  <email>Jesper.Aaberg@contoso.com</email>
</author>
<contributor>
  <name>Lene Aalling</name>
  <uri>http://Lene/Aaling</uri>
  <email>Lene.Aaling@contoso.com</email>
</contributor>

The following XML shows how the Name is serialized for RSS 2.0.

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

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