AW.Webapi.Sample.Areas.HelpPage.HelpPageConfigurationExtensions.SetSampleForType C# (CSharp) Method

SetSampleForType() public static method

Sets the sample directly for all actions with the specified type and media type.
public static SetSampleForType ( this config, object sample, MediaTypeHeaderValue mediaType, Type type ) : void
config this The .
sample object The sample.
mediaType System.Net.Http.Headers.MediaTypeHeaderValue The media type.
type System.Type The parameter type or return type of an action.
return void
        public static void SetSampleForType(this HttpConfiguration config, object sample, MediaTypeHeaderValue mediaType, Type type)
        {
            config.GetHelpPageSampleGenerator().ActionSamples.Add(new HelpPageSampleKey(mediaType, type), sample);
        }