C# Класс System.Net.Http.Formatting.BetterJsonMediaTypeFormatter

MediaTypeFormatter class to handle Json.
Наследование: System.Net.Http.Formatting.MediaTypeFormatter
Показать файл Открыть проект

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
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.

Приватные методы

Метод Описание
IsKnownUnserializableType ( Type type ) : bool

Описание методов

BetterJsonMediaTypeFormatter() публичный Метод

Initializes a new instance of the JsonMediaTypeFormatter class.
public BetterJsonMediaTypeFormatter ( ) : System.Collections
Результат System.Collections

CanReadType() защищенный Метод

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.
Результат bool

CanWriteType() защищенный Метод

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.
Результат bool

CreateDefaultSerializerSettings() публичный Метод

Creates a JsonSerializerSettings instance with the default settings used by the JsonMediaTypeFormatter.
public CreateDefaultSerializerSettings ( ) : JsonSerializerSettings
Результат Newtonsoft.Json.JsonSerializerSettings

OnReadFromStreamAsync() защищенный Метод

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
Результат Task

OnWriteToStreamAsync() защищенный Метод

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 .
Результат System.Threading.Tasks.Task