XmlSyndicationContent.ReadContent Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Reads content into the XmlSyndicationContent instance.
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. |
- Source:
- XmlSyndicationContent.cs
- Source:
- XmlSyndicationContent.cs
- Source:
- XmlSyndicationContent.cs
Reads the content of the specified type into the XmlSyndicationContent.
public:
generic <typename TContent>
TContent ReadContent();
public TContent ReadContent<TContent> ();
member this.ReadContent : unit -> 'Content
Public Function ReadContent(Of TContent) () As TContent
Type Parameters
- TContent
The type of content to read.
Returns
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) |
- Source:
- XmlSyndicationContent.cs
- Source:
- XmlSyndicationContent.cs
- Source:
- XmlSyndicationContent.cs
Reads the content of the specified type into the XmlSyndicationContent using the specified serializer.
public:
generic <typename TContent>
TContent ReadContent(System::Runtime::Serialization::XmlObjectSerializer ^ dataContractSerializer);
public TContent ReadContent<TContent> (System.Runtime.Serialization.XmlObjectSerializer dataContractSerializer);
member this.ReadContent : System.Runtime.Serialization.XmlObjectSerializer -> 'Content
Public Function ReadContent(Of TContent) (dataContractSerializer As XmlObjectSerializer) As TContent
Type Parameters
- TContent
The type of content to read.
Parameters
- dataContractSerializer
- XmlObjectSerializer
The XmlObjectSerializer to use.
Returns
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) |
- Source:
- XmlSyndicationContent.cs
- Source:
- XmlSyndicationContent.cs
- Source:
- XmlSyndicationContent.cs
Reads the content of the specified type into the XmlSyndicationContent using the specified serializer.
public:
generic <typename TContent>
TContent ReadContent(System::Xml::Serialization::XmlSerializer ^ serializer);
public TContent ReadContent<TContent> (System.Xml.Serialization.XmlSerializer serializer);
member this.ReadContent : System.Xml.Serialization.XmlSerializer -> 'Content
Public Function ReadContent(Of TContent) (serializer As XmlSerializer) As TContent
Type Parameters
- TContent
The type of content to read.
Parameters
- serializer
- XmlSerializer
The XmlSerializer to use.
Returns
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) |
.NET feedback
.NET er et åben kildekode projekt. Vælg et link for at give feedback: