XmlSyndicationContent.ReadContent Method

Definition

Reads content into the XmlSyndicationContent instance.

Overloads

ReadContent<TContent>()

Reads the content of the specified type into the XmlSyndicationContent.

ReadContent<TContent>(XmlObjectSerializer)

Reads the content of the specified type into the XmlSyndicationContent using the specified serializer.

ReadContent<TContent>(XmlSerializer)

Reads the content of the specified type into the XmlSyndicationContent using the specified serializer.

ReadContent<TContent>()

Source:
XmlSyndicationContent.cs
Source:
XmlSyndicationContent.cs
Source:
XmlSyndicationContent.cs

Reads the content of the specified type into the XmlSyndicationContent.

public TContent ReadContent<TContent> ();

Type Parameters

TContent

The type of content to read.

Returns

TContent

An object of the specified type.

Exceptions

The input XML cannot be deserialized into the requested type.

Remarks

On the receive/deserialization side, if the XML syndication content element is an empty XML element, then default(TContent) is returned. If not, a new instance of DataContractSerializer is created and is used to deserialize the inner XML of the XML syndication content element into an instance of TContent.

Applies to

.NET 9 (package-provided) og andre versioner
Produkt 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)

ReadContent<TContent>(XmlObjectSerializer)

Source:
XmlSyndicationContent.cs
Source:
XmlSyndicationContent.cs
Source:
XmlSyndicationContent.cs

Reads the content of the specified type into the XmlSyndicationContent using the specified serializer.

public TContent ReadContent<TContent> (System.Runtime.Serialization.XmlObjectSerializer dataContractSerializer);

Type Parameters

TContent

The type of content to read.

Parameters

dataContractSerializer
XmlObjectSerializer

The XmlObjectSerializer to use.

Returns

TContent

An object of the specified type.

Exceptions

The input XML cannot be deserialized into the requested type.

Remarks

On the receive/deserialization side, if the XML syndication content element is an empty XML element, then default(TContent) is returned. If not, the instance of XmlObjectSerializer passed in is used to deserialize the inner XML of XML syndication content element into an instance of TContent.

Applies to

.NET 9 (package-provided) og andre versioner
Produkt 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)

ReadContent<TContent>(XmlSerializer)

Source:
XmlSyndicationContent.cs
Source:
XmlSyndicationContent.cs
Source:
XmlSyndicationContent.cs

Reads the content of the specified type into the XmlSyndicationContent using the specified serializer.

public TContent ReadContent<TContent> (System.Xml.Serialization.XmlSerializer serializer);

Type Parameters

TContent

The type of content to read.

Parameters

serializer
XmlSerializer

The XmlSerializer to use.

Returns

TContent

An object of the specified type.

Exceptions

The input XML cannot be deserialized into the requested type.

Remarks

On the receive/deserialization side, if the XML syndication content element is an empty XML element, then default(TContent) is returned. If not, the instance of XmlSerializer passed in is used to deserialize the inner XML of XML syndication content element into an instance of TContent.

Applies to

.NET 9 (package-provided) og andre versioner
Produkt 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)