SyndicationLink.CreateSelfLink Method

Definition

Creates a new SyndicationLink with the relationship type set to self.

Overloads

CreateSelfLink(Uri, String)

Creates a new SyndicationLink with the specified URI, media type, and relationship type set to self.

CreateSelfLink(Uri)

Creates a new SyndicationLink with the specified URI and relationship type set to self.

Remarks

This method creates a new SyndicationLink object and sets RelationshipType to self.

Source:
SyndicationLink.cs
Source:
SyndicationLink.cs
Source:
SyndicationLink.cs

Creates a new SyndicationLink with the specified URI, media type, and relationship type set to self.

public static System.ServiceModel.Syndication.SyndicationLink CreateSelfLink (Uri uri, string mediaType);

Parameters

uri
Uri

The URI to the linked resource.

mediaType
String

The media type of the link.

Returns

A SyndicationLink instance.

Examples

The following example shows how to create a self link.

SyndicationLink link = SyndicationLink.CreateSelfLink(new Uri("http://server/link"), "text/html");

Applies to

.NET 9 (package-provided) et autres versions
Produit Versions
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Source:
SyndicationLink.cs
Source:
SyndicationLink.cs
Source:
SyndicationLink.cs

Creates a new SyndicationLink with the specified URI and relationship type set to self.

public static System.ServiceModel.Syndication.SyndicationLink CreateSelfLink (Uri uri);

Parameters

uri
Uri

The URI to the linked resource.

Returns

A SyndicationLink instance.

Examples

The following example shows how to create a self link.

SyndicationLink link = SyndicationLink.CreateSelfLink(new Uri("http://server/link"));

Applies to

.NET 9 (package-provided) et autres versions
Produit Versions
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0 (package-provided)