private static IsFormatSupported ( SampleDirection sampleDirection, MediaTypeFormatter formatter, Type type ) : bool | ||
sampleDirection | SampleDirection | |
formatter | MediaTypeFormatter | |
type | Type | |
리턴 | bool |
private static bool IsFormatSupported(SampleDirection sampleDirection, MediaTypeFormatter formatter, Type type)
{
switch (sampleDirection)
{
case SampleDirection.Request:
return formatter.CanReadType(type);
case SampleDirection.Response:
return formatter.CanWriteType(type);
}
return false;
}