JsonContentNegotiator Class

Namespace:
Weavy.Web.Api.Formatters
Assembly:
Weavy.Web.dll

A content negotiator that always returns aplication/json.

public class JsonContentNegotiator : IContentNegotiator
Inheritance:
System.Object → JsonContentNegotiator

Constructors

JsonContentNegotiator() Initializes a new instance of the JsonContentNegotiator class.

Methods

Negotiate(Type, HttpRequestMessage, IEnumerableTypeFormatter>) Always returns a JsonMediaTypeFormatter.

Extension Methods

Serialize(object) Serializes an object, or graph of connected objects, to a byte array.
SerializeToJson(object, Formatting?, JsonSerializerSettings) Serializes an object, or graph of connected objects, to a json string.
IsValid(object) Determines whether the specified object is valid by evaluating each ValidationAttribute instance that is attached to the object type.