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