SyndicationFeed.Load Method

Definition

Overloads

Load(XmlReader)

Loads a syndication feed from the specified XML reader.

Load<TSyndicationFeed>(XmlReader)

Loads a SyndicationFeed-derived instance from the specified XmlReader.

Load(XmlReader)

Source:
SyndicationFeed.cs
Source:
SyndicationFeed.cs
Source:
SyndicationFeed.cs

Loads a syndication feed from the specified XML reader.

C#
public static System.ServiceModel.Syndication.SyndicationFeed Load(System.Xml.XmlReader reader);

Parameters

reader
XmlReader

The XmlReader to load the feed from.

Returns

A SyndicationFeed that contains the loaded contents.

Examples

The following example demonstrates how to call this method.

C#
XmlReader reader = XmlReader.Create("http://localhost/feeds/serializedFeed.xml");
SyndicationFeed feed = SyndicationFeed.Load(reader);

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (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, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)

Load<TSyndicationFeed>(XmlReader)

Source:
SyndicationFeed.cs
Source:
SyndicationFeed.cs
Source:
SyndicationFeed.cs

Loads a SyndicationFeed-derived instance from the specified XmlReader.

C#
public static TSyndicationFeed Load<TSyndicationFeed>(System.Xml.XmlReader reader) where TSyndicationFeed : System.ServiceModel.Syndication.SyndicationFeed, new();

Type Parameters

TSyndicationFeed

The syndication feed type.

Parameters

reader
XmlReader

The XmlReader to read from.

Returns

TSyndicationFeed

A SyndicationFeed-derived instance that contains the feed.

Exceptions

Invalid XML encountered during read.

Examples

The following code shows how to load a syndication feed from an XmlReader instance.

C#
XmlReader reader = XmlReader.Create("http://localhost/feeds/serializedFeed.xml");
SyndicationFeed feed = SyndicationFeed.Load(reader);

Remarks

Use this method when you are loading a syndication item into a class derived from SyndicationFeed.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (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, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)