ReqRest
Show / Hide Table of Contents

Class HttpContentDeserializerExtensions

Extends the IHttpContentDeserializer with default extension methods.

Inheritance
Object
HttpContentDeserializerExtensions
Namespace: ReqRest.Serializers
Assembly: ReqRest.dll
Syntax
public static class HttpContentDeserializerExtensions

Methods

DeserializeAsync<T>(IHttpContentDeserializer, Nullable<HttpContent>)

Deserializes an object of the specified type T from the httpContent.

Declaration
public static Task<T> DeserializeAsync<T>(this IHttpContentDeserializer serializer, HttpContent? httpContent)
Parameters
Type Name Description
IHttpContentDeserializer serializer

The serializer.

Nullable<HttpContent> httpContent

An HttpContent instance from which the content should be serialized. This can be null.

Returns
Type Description
Task<T>

An object of type T.

Type Parameters
Name Description
T

The target type of the object which is supposed to be deserialized.

Exceptions
Type Condition
ArgumentNullException
  • serializer
InvalidCastException

The serializer returned an object which is not of type T.

HttpContentSerializationException

Deserializing the content failed.

Back to top Copyright © 2019 ReqRest - Generated with DocFX - Material Theme made by Oscar Vásquez - Impressum (Imprint)