BsonMediaTypeFormatter Class
Represents a media type formatter to handle Bson.
Namespace: System.Net.Http.Formatting
Assembly: System.Net.Http.Formatting (in System.Net.Http.Formatting.dll)
Inheritance Hierarchy
System.Object
System.Net.Http.Formatting.MediaTypeFormatter
System.Net.Http.Formatting.BaseJsonMediaTypeFormatter
System.Net.Http.Formatting.BsonMediaTypeFormatter
Syntax
public class BsonMediaTypeFormatter : BaseJsonMediaTypeFormatter
public ref class BsonMediaTypeFormatter : BaseJsonMediaTypeFormatter
type BsonMediaTypeFormatter =
class
inherit BaseJsonMediaTypeFormatter
end
Public Class BsonMediaTypeFormatter
Inherits BaseJsonMediaTypeFormatter
Constructors
Name | Description | |
---|---|---|
BsonMediaTypeFormatter() | Initializes a new instance of theBsonMediaTypeFormatter class. |
|
BsonMediaTypeFormatter(BsonMediaTypeFormatter) | Initializes a new instance of theBsonMediaTypeFormatter class. |
Properties
Name | Description | |
---|---|---|
DefaultMediaType | Gets the default media type for Json, namely "application/bson". |
|
MaxDepth | Gets or sets the maximum depth allowed by this formatter.(Overrides BaseJsonMediaTypeFormatter.MaxDepth.) |
|
MediaTypeMappings | Gets the mutable collection of MediaTypeMapping objects that match HTTP requests to media types.(Inherited from MediaTypeFormatter.) |
|
RequiredMemberSelector | Gets or sets the IRequiredMemberSelector instance used to determine required members.(Inherited from MediaTypeFormatter.) |
|
SerializerSettings | Gets or sets the JsonSerializerSettings used to configure the JsonSerializer.(Inherited from BaseJsonMediaTypeFormatter.) |
|
SupportedEncodings | Gets the mutable collection of character encodings supported bythis MediaTypeFormatter.(Inherited from MediaTypeFormatter.) |
|
SupportedMediaTypes | Gets the mutable collection of media types supported bythis MediaTypeFormatter.(Inherited from MediaTypeFormatter.) |
Methods
Name | Description | |
---|---|---|
CanReadType(Type) | Determines whether this formatter can read objects of the specified type.(Inherited from BaseJsonMediaTypeFormatter.) |
|
CanWriteType(Type) | Determines whether this formatter can write objects of the specified type.(Inherited from BaseJsonMediaTypeFormatter.) |
|
CreateDefaultSerializerSettings() | Creates a JsonSerializerSettings instance with the default settings used by the BaseJsonMediaTypeFormatter.(Inherited from BaseJsonMediaTypeFormatter.) |
|
CreateJsonReader(Type, Stream, Encoding) | Called during deserialization to get the JsonReader.(Overrides BaseJsonMediaTypeFormatter.CreateJsonReader(Type, Stream, Encoding).) |
|
CreateJsonSerializer() | Called during serialization and deserialization to get the JsonSerializer.(Inherited from BaseJsonMediaTypeFormatter.) |
|
CreateJsonWriter(Type, Stream, Encoding) | Called during serialization to get the JsonWriter.(Overrides BaseJsonMediaTypeFormatter.CreateJsonWriter(Type, Stream, Encoding).) |
|
Equals(Object) | (Inherited from Object.) |
|
Finalize() | (Inherited from Object.) |
|
GetHashCode() | (Inherited from Object.) |
|
GetPerRequestFormatterInstance(Type, HttpRequestMessage, MediaTypeHeaderValue) | Returns a specialized instance of the MediaTypeFormatter that can format a response for the given parameters.(Inherited from MediaTypeFormatter.) |
|
GetType() | (Inherited from Object.) |
|
MemberwiseClone() | (Inherited from Object.) |
|
ReadFromStream(Type, Stream, Encoding, IFormatterLogger) | Called during deserialization to read an object of the specified type from the specified stream.(Overrides BaseJsonMediaTypeFormatter.ReadFromStream(Type, Stream, Encoding, IFormatterLogger).) |
|
ReadFromStreamAsync(Type, Stream, HttpContent, IFormatterLogger) | Called during deserialization to read an object of the specified type from the specified stream.(Overrides BaseJsonMediaTypeFormatter.ReadFromStreamAsync(Type, Stream, HttpContent, IFormatterLogger).) |
|
ReadFromStreamAsync(Type, Stream, HttpContent, IFormatterLogger, CancellationToken) | Asynchronously deserializes an object of the specified type.(Inherited from MediaTypeFormatter.) |
|
SelectCharacterEncoding(HttpContentHeaders) | Determines the best character encoding for reading or writing an HTTP entity body, given a set of content headers.(Inherited from MediaTypeFormatter.) |
|
SetDefaultContentHeaders(Type, HttpContentHeaders, MediaTypeHeaderValue) | Sets the default headers for content that will be formatted using this formatter. This method is called from the ObjectContent constructor. This implementation sets the Content-Type header to the value of mediaType if it is not null. If it is null it sets the Content-Type to the default media type of this formatter. If the Content-Type does not specify a charset it will set it using this formatters configured Encoding. (Inherited from MediaTypeFormatter.) |
|
ToString() | (Inherited from Object.) |
|
WriteToStream(Type, Object, Stream, Encoding) | Called during serialization to write an object of the specified type to the specified stream.(Overrides BaseJsonMediaTypeFormatter.WriteToStream(Type, Object, Stream, Encoding).) |
|
WriteToStreamAsync(Type, Object, Stream, HttpContent, TransportContext) | Asynchronously writes an object of the specified type.(Inherited from MediaTypeFormatter.) |
|
WriteToStreamAsync(Type, Object, Stream, HttpContent, TransportContext, CancellationToken) | Called during serialization to write an object of the specified type to the specified stream.(Inherited from BaseJsonMediaTypeFormatter.) |
Extension Methods
Name | Description | |
---|---|---|
AddQueryStringMapping(String, String, MediaTypeHeaderValue) | Overloaded. (Defined by MediaTypeFormatterExtensions.) |
|
AddQueryStringMapping(String, String, String) | Overloaded. (Defined by MediaTypeFormatterExtensions.) |
|
AddRequestHeaderMapping(String, String, StringComparison, Boolean, MediaTypeHeaderValue) | Overloaded. (Defined by MediaTypeFormatterExtensions.) |
|
AddRequestHeaderMapping(String, String, StringComparison, Boolean, String) | Overloaded. (Defined by MediaTypeFormatterExtensions.) |
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also
System.Net.Http.Formatting Namespace
Return to top