Kartverket.MetadataEditor.Areas.HelpPage.HelpPageSampleGenerator.IsFormatSupported C# (CSharp) Method

IsFormatSupported() private static method

private static IsFormatSupported ( SampleDirection sampleDirection, System.Net.Http.Formatting.MediaTypeFormatter formatter, Type type ) : bool
sampleDirection SampleDirection
formatter System.Net.Http.Formatting.MediaTypeFormatter
type System.Type
return 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;
        }