C# 클래스 MvcApi.Formatting.MediaTypeFormatter

파일 보기 프로젝트 열기: dax70/MvcApi 1 사용 예제들

공개 메소드들

메소드 설명
CanWriteType ( Type type ) : bool
ExecuteFormat ( Type type, object returnValue, FormatterContext formatterContext ) : void
GetPerRequestFormatterInstance ( Type type, HttpRequestMessage request, MediaTypeHeaderValue mediaType ) : MediaTypeFormatter

Returns a specialized instance of the MediaTypeFormatter that can handle formatting a response for the given parameters. This method is called by DefaultContentNegotiator after a formatter has been selected through content negotiation.

The default implementation returns this instance. Derived classes can choose to return a new instance if they need to close over any of the parameters.

SelectCharacterEncoding ( HttpRequestMessage contentHeaders ) : Encoding

Determines the best Encoding amongst the supported encodings for reading or writing an HTTP entity body based on the provided contentHeaders.

비공개 메소드들

메소드 설명
GetOrAddDelegatingType ( Type type ) : Type
GetResponseHeaders ( Type objectType, string mediaType, HttpResponseMessage responseMessage ) : string>>.IEnumerable
GetTypeRemappingConstructor ( Type type ) : ConstructorInfo
InitializeDefaultCollectionKeySize ( ) : int
MediaTypeFormatter ( ) : System
OnGetResponseHeaders ( Type objectType, string mediaType, HttpResponseMessage responseMessage ) : string>>.IEnumerable
TryGetDelegatingType ( Type interfaceType, Type &type ) : bool
TryGetDelegatingType1 ( Type interfaceType, Type &type ) : bool
TryGetDelegatingTypeForIEnumerableGenericOrSame ( Type &type ) : bool
TryGetDelegatingTypeForIQueryableGenericOrSame ( Type &type ) : bool
TryMatchMediaTypeMapping ( HttpRequestMessage request, MediaTypeFormatterMatch &mediaTypeMatch ) : bool
TryMatchMediaTypeMapping ( HttpResponseMessage response, MediaTypeFormatterMatch &mediaTypeMatch ) : bool

메소드 상세

CanWriteType() 공개 추상적인 메소드

public abstract CanWriteType ( Type type ) : bool
type System.Type
리턴 bool

ExecuteFormat() 공개 추상적인 메소드

public abstract ExecuteFormat ( Type type, object returnValue, FormatterContext formatterContext ) : void
type Type
returnValue object
formatterContext FormatterContext
리턴 void

GetPerRequestFormatterInstance() 공개 메소드

Returns a specialized instance of the MediaTypeFormatter that can handle formatting a response for the given parameters. This method is called by DefaultContentNegotiator after a formatter has been selected through content negotiation.
The default implementation returns this instance. Derived classes can choose to return a new instance if they need to close over any of the parameters.
public GetPerRequestFormatterInstance ( Type type, HttpRequestMessage request, MediaTypeHeaderValue mediaType ) : MediaTypeFormatter
type Type The type being serialized.
request HttpRequestMessage The request.
mediaType MediaTypeHeaderValue The media type chosen for the serialization. Can be null.
리턴 MediaTypeFormatter

SelectCharacterEncoding() 공개 메소드

Determines the best Encoding amongst the supported encodings for reading or writing an HTTP entity body based on the provided contentHeaders.
public SelectCharacterEncoding ( HttpRequestMessage contentHeaders ) : Encoding
contentHeaders HttpRequestMessage The content headers provided as part of the request or response.
리턴 Encoding