C# Class Saule.Http.JsonApiMediaTypeFormatter

Custom media type formatter for Json Api (1.0) responses and requests.
Inheritance: System.Net.Http.Formatting.MediaTypeFormatter
Afficher le fichier Open project: joukevandermaas/saule Class Usage Examples

Méthodes publiques

Méthode Description
CanReadType ( Type type ) : bool
CanWriteType ( Type type ) : bool
GetPerRequestFormatterInstance ( Type type, HttpRequestMessage request, MediaTypeHeaderValue mediaType ) : System.Net.Http.Formatting.MediaTypeFormatter
ReadFromStreamAsync ( Type type, Stream readStream, HttpContent content, IFormatterLogger formatterLogger ) : Task
WriteToStreamAsync ( Type type, object value, Stream writeStream, HttpContent content, System.Net.TransportContext transportContext ) : System.Threading.Tasks.Task

Private Methods

Méthode Description
JsonApiMediaTypeFormatter ( ) : System
JsonApiMediaTypeFormatter ( HttpRequestMessage request, Saule.Http.JsonApiConfiguration config ) : System
JsonApiMediaTypeFormatter ( IUrlPathBuilder urlBuilder ) : System
JsonApiMediaTypeFormatter ( Saule.Http.JsonApiConfiguration config ) : System
WriteJsonToStream ( JToken json, Stream stream ) : System.Threading.Tasks.Task

Method Details

CanReadType() public méthode

public CanReadType ( Type type ) : bool
type System.Type
Résultat bool

CanWriteType() public méthode

public CanWriteType ( Type type ) : bool
type System.Type
Résultat bool

GetPerRequestFormatterInstance() public méthode

public GetPerRequestFormatterInstance ( Type type, HttpRequestMessage request, MediaTypeHeaderValue mediaType ) : System.Net.Http.Formatting.MediaTypeFormatter
type System.Type
request System.Net.Http.HttpRequestMessage
mediaType System.Net.Http.Headers.MediaTypeHeaderValue
Résultat System.Net.Http.Formatting.MediaTypeFormatter

ReadFromStreamAsync() public méthode

public ReadFromStreamAsync ( Type type, Stream readStream, HttpContent content, IFormatterLogger formatterLogger ) : Task
type System.Type
readStream Stream
content System.Net.Http.HttpContent
formatterLogger IFormatterLogger
Résultat Task

WriteToStreamAsync() public méthode

public WriteToStreamAsync ( Type type, object value, Stream writeStream, HttpContent content, System.Net.TransportContext transportContext ) : System.Threading.Tasks.Task
type System.Type
value object
writeStream Stream
content System.Net.Http.HttpContent
transportContext System.Net.TransportContext
Résultat System.Threading.Tasks.Task