C# Class System.Net.Http.Formatting.BetterJsonMediaTypeFormatter

MediaTypeFormatter class to handle Json.
Inheritance: System.Net.Http.Formatting.MediaTypeFormatter
Afficher le fichier Open project: anurse/ReviewR

Méthodes publiques

Méthode Description
BetterJsonMediaTypeFormatter ( ) : System.Collections

Initializes a new instance of the JsonMediaTypeFormatter class.

CreateDefaultSerializerSettings ( ) : JsonSerializerSettings

Creates a JsonSerializerSettings instance with the default settings used by the JsonMediaTypeFormatter.

Méthodes protégées

Méthode Description
CanReadType ( Type type ) : bool

Determines whether this JsonMediaTypeFormatter can read objects of the specified type.

CanWriteType ( Type type ) : bool

Determines whether this JsonMediaTypeFormatter can write objects of the specified type.

OnReadFromStreamAsync ( Type type, Stream stream, HttpContentHeaders contentHeaders, FormatterContext formatterContext ) : Task

Called during deserialization to read an object of the specified type from the specified stream.

OnWriteToStreamAsync ( Type type, object value, Stream stream, HttpContentHeaders contentHeaders, FormatterContext formatterContext, TransportContext transportContext ) : System.Threading.Tasks.Task

Called during serialization to write an object of the specified type to the specified stream.

Private Methods

Méthode Description
IsKnownUnserializableType ( Type type ) : bool

Method Details

BetterJsonMediaTypeFormatter() public méthode

Initializes a new instance of the JsonMediaTypeFormatter class.
public BetterJsonMediaTypeFormatter ( ) : System.Collections
Résultat System.Collections

CanReadType() protected méthode

Determines whether this JsonMediaTypeFormatter can read objects of the specified type.
protected CanReadType ( Type type ) : bool
type Type The type of object that will be read.
Résultat bool

CanWriteType() protected méthode

Determines whether this JsonMediaTypeFormatter can write objects of the specified type.
protected CanWriteType ( Type type ) : bool
type Type The type of object that will be written.
Résultat bool

CreateDefaultSerializerSettings() public méthode

Creates a JsonSerializerSettings instance with the default settings used by the JsonMediaTypeFormatter.
public CreateDefaultSerializerSettings ( ) : JsonSerializerSettings
Résultat Newtonsoft.Json.JsonSerializerSettings

OnReadFromStreamAsync() protected méthode

Called during deserialization to read an object of the specified type from the specified stream.
protected OnReadFromStreamAsync ( Type type, Stream stream, HttpContentHeaders contentHeaders, FormatterContext formatterContext ) : Task
type Type The type of object to read.
stream System.IO.Stream The from which to read.
contentHeaders System.Net.Http.Headers.HttpContentHeaders The for the content being written.
formatterContext FormatterContext
Résultat Task

OnWriteToStreamAsync() protected méthode

Called during serialization to write an object of the specified type to the specified stream.
protected OnWriteToStreamAsync ( Type type, object value, Stream stream, HttpContentHeaders contentHeaders, FormatterContext formatterContext, TransportContext transportContext ) : System.Threading.Tasks.Task
type Type The type of object to write.
value object The object to write.
stream System.IO.Stream The to which to write.
contentHeaders System.Net.Http.Headers.HttpContentHeaders The for the content being written.
formatterContext FormatterContext
transportContext TransportContext The .
Résultat System.Threading.Tasks.Task