12 instantiations of MediaTypeSegmentWithQuality
Microsoft.AspNetCore.Mvc.Core (1)
Formatters\MediaType.cs (1)
293return new MediaTypeSegmentWithQuality(
Microsoft.AspNetCore.Mvc.Core.Test (11)
Formatters\AcceptHeaderParserTest.cs (11)
17new MediaTypeSegmentWithQuality(new StringSegment("application/json"),1.0) 34new MediaTypeSegmentWithQuality(new StringSegment("application/json"),1.0), 35new MediaTypeSegmentWithQuality(new StringSegment("application/xml;q=0.8"),0.8) 56new MediaTypeSegmentWithQuality(new StringSegment("application/json"),1.0), 57new MediaTypeSegmentWithQuality(new StringSegment("application/xml"),1.0), 95var expectedMediaTypes = expected.Select(e => new MediaTypeSegmentWithQuality(new StringSegment(e), 1.0)).ToList(); 110new MediaTypeSegmentWithQuality(new StringSegment("application/json"), 1.0), 111new MediaTypeSegmentWithQuality(new StringSegment("application/xml;q=0.8"), 0.8) 160new MediaTypeSegmentWithQuality(new StringSegment("*/*Content-Type"), 1.0), 161new MediaTypeSegmentWithQuality(new StringSegment("application/json"), 1.0), 179new MediaTypeSegmentWithQuality(new StringSegment("application/json"), 1.0),
37 references to MediaTypeSegmentWithQuality
Microsoft.AspNetCore.Mvc.Core (25)
Formatters\AcceptHeaderParser.cs (9)
11public static IList<MediaTypeSegmentWithQuality> ParseAcceptHeader(IList<string> acceptHeaders) 13var parsedValues = new List<MediaTypeSegmentWithQuality>(); 19public static void ParseAcceptHeader(IList<string> acceptHeaders, IList<MediaTypeSegmentWithQuality> parsedValues) 32if (TryParseValue(value, ref charIndex, out var output)) 50private static bool TryParseValue(string value, ref int index, out MediaTypeSegmentWithQuality parsedValue) 52parsedValue = default(MediaTypeSegmentWithQuality); 79var result = default(MediaTypeSegmentWithQuality); 153out MediaTypeSegmentWithQuality result)
Formatters\MediaType.cs (4)
254/// Creates an <see cref="MediaTypeSegmentWithQuality"/> containing the media type in <paramref name="mediaType"/> 260public static MediaTypeSegmentWithQuality CreateMediaTypeSegmentWithQuality(string mediaType, int start) 269return default(MediaTypeSegmentWithQuality); 290return default(MediaTypeSegmentWithQuality);
Formatters\MediaTypeSegmentWithQuality.cs (3)
14/// Initializes an instance of <see cref="MediaTypeSegmentWithQuality"/>. 25/// Gets the media type of this <see cref="MediaTypeSegmentWithQuality"/>. 30/// Gets the quality of this <see cref="MediaTypeSegmentWithQuality"/>.
Infrastructure\DefaultOutputFormatterSelector.cs (9)
22private static readonly Comparison<MediaTypeSegmentWithQuality> _sortFunction = (left, right) => 149private List<MediaTypeSegmentWithQuality> GetAcceptableMediaTypes(HttpRequest request) 151var result = new List<MediaTypeSegmentWithQuality>(); 191IList<MediaTypeSegmentWithQuality> sortedAcceptHeaders) 195var mediaType = sortedAcceptHeaders[i]; 238IList<MediaTypeSegmentWithQuality> sortedAcceptableContentTypes, 304public static partial void NoFormatterFromNegotiation(ILogger logger, IList<MediaTypeSegmentWithQuality> acceptTypes); 307public static partial void SelectingOutputFormatterUsingAcceptHeader(ILogger logger, IEnumerable<MediaTypeSegmentWithQuality> acceptHeader); 310public static partial void SelectingOutputFormatterUsingAcceptHeaderAndExplicitContentTypes(ILogger logger, IEnumerable<MediaTypeSegmentWithQuality> acceptHeader, MediaTypeCollection explicitContentTypes);
Microsoft.AspNetCore.Mvc.Core.Test (12)
Formatters\AcceptHeaderParserTest.cs (11)
15var expected = new List<MediaTypeSegmentWithQuality> 32var expected = new List<MediaTypeSegmentWithQuality> 54var expectedMediaTypes = new List<MediaTypeSegmentWithQuality> 108var expected = new List<MediaTypeSegmentWithQuality> 128var expected = new MediaTypeSegmentWithQuality[0]; 143var expected = new MediaTypeSegmentWithQuality[0]; 158var expected = new MediaTypeSegmentWithQuality[] 177var expected = new MediaTypeSegmentWithQuality[] 195var expected = new MediaTypeSegmentWithQuality[0]; 210var expected = new MediaTypeSegmentWithQuality[0]; 225var expected = new MediaTypeSegmentWithQuality[0];
Formatters\MediaTypeTest.cs (1)
363var mediaTypeSegment = MediaType.CreateMediaTypeSegmentWithQuality(value, start: 0);