C# Class Hypermedia.JsonApi.WebApi.JsonApiMediaTypeFormatter

Inheritance: Hypermedia.WebApi.Json.JsonMediaTypeFormatter
Afficher le fichier Open project: cosullivan/Hypermedia

Méthodes publiques

Méthode Description
GetPerRequestFormatterInstance ( Type type, HttpRequestMessage request, MediaTypeHeaderValue mediaType ) : System.Net.Http.Formatting.MediaTypeFormatter

Returns a specialized instance of the T:System.Net.Http.Formatting.MediaTypeFormatter that can format a response for the given parameters.

JsonApiMediaTypeFormatter ( IContractResolver contractResolver ) : System

Constructor.

JsonApiMediaTypeFormatter ( IContractResolver contractResolver, IFieldNamingStrategy fieldNamingStratgey ) : System

Constructor.

Méthodes protégées

Méthode Description
CanReadOrWrite ( Type type ) : bool

Returns a value indicating whether or not the dictionary has a metadata mapping for the given type.

CreatePatch ( Type type, IContractResolver contractResolver, JsonLite.Ast.JsonValue jsonValue ) : IPatch

Creates an instance of the patch object for the media type.

DeserializeValue ( Type type, JsonLite.Ast.JsonValue jsonValue ) : object

Deserialize an object.

SerializeValue ( Type type, object value ) : JsonLite.Ast.JsonValue

Serialize the value into an JSON AST.

Private Methods

Méthode Description
JsonApiMediaTypeFormatter ( IContractResolver contractResolver, IFieldNamingStrategy fieldNamingStratgey, bool prettify ) : System

Constructor.

Method Details

CanReadOrWrite() protected méthode

Returns a value indicating whether or not the dictionary has a metadata mapping for the given type.
protected CanReadOrWrite ( Type type ) : bool
type System.Type The element type to test for a mapping.
Résultat bool

CreatePatch() protected méthode

Creates an instance of the patch object for the media type.
protected CreatePatch ( Type type, IContractResolver contractResolver, JsonLite.Ast.JsonValue jsonValue ) : IPatch
type System.Type The type of the inner instance that is being patched.
contractResolver IContractResolver The contract resolver.
jsonValue JsonLite.Ast.JsonValue The JSON value that represents the patch values.
Résultat IPatch

DeserializeValue() protected méthode

Deserialize an object.
protected DeserializeValue ( Type type, JsonLite.Ast.JsonValue jsonValue ) : object
type System.Type The type of the object to deserialize.
jsonValue JsonLite.Ast.JsonValue The JSON value that represents the object to deserialize.
Résultat object

GetPerRequestFormatterInstance() public méthode

Returns a specialized instance of the T:System.Net.Http.Formatting.MediaTypeFormatter that can format a response for the given parameters.
public GetPerRequestFormatterInstance ( Type type, HttpRequestMessage request, MediaTypeHeaderValue mediaType ) : System.Net.Http.Formatting.MediaTypeFormatter
type System.Type The type to format.
request System.Net.Http.HttpRequestMessage The request.
mediaType System.Net.Http.Headers.MediaTypeHeaderValue The media type.
Résultat System.Net.Http.Formatting.MediaTypeFormatter

JsonApiMediaTypeFormatter() public méthode

Constructor.
public JsonApiMediaTypeFormatter ( IContractResolver contractResolver ) : System
contractResolver IContractResolver The resource contract resolver used to resolve the contracts at runtime.
Résultat System

JsonApiMediaTypeFormatter() public méthode

Constructor.
public JsonApiMediaTypeFormatter ( IContractResolver contractResolver, IFieldNamingStrategy fieldNamingStratgey ) : System
contractResolver IContractResolver The resource contract resolver used to resolve the contracts at runtime.
fieldNamingStratgey IFieldNamingStrategy The field naming strategy to use.
Résultat System

SerializeValue() protected méthode

Serialize the value into an JSON AST.
protected SerializeValue ( Type type, object value ) : JsonLite.Ast.JsonValue
type System.Type The type to serialize from.
value object The value to serialize.
Résultat JsonLite.Ast.JsonValue