48 writes to ContentType
Microsoft.AspNetCore.Mvc.Core (7)
Formatters\OutputFormatter.cs (2)
115context.ContentType = new StringSegment(SupportedMediaTypes[0]); 146context.ContentType = new StringSegment(SupportedMediaTypes[i]);
Formatters\TextOutputFormatter.cs (1)
145context.ContentType = selectedMediaType;
Infrastructure\DefaultOutputFormatterSelector.cs (4)
176formatterContext.ContentType = new StringSegment(); 197formatterContext.ContentType = mediaType.MediaType; 222formatterContext.ContentType = new StringSegment(contentType); 252formatterContext.ContentType = new StringSegment(possibleOutputContentTypes[j]);
Microsoft.AspNetCore.Mvc.Core.Test (28)
Formatters\JsonOutputFormatterTestBase.cs (4)
46ContentType = new StringSegment(mediaType), 97ContentType = new StringSegment(mediaType.ToString()), 129ContentType = new StringSegment(mediaType.ToString()), 190ContentType = new StringSegment(contentType),
Formatters\NoContentFormatterTests.cs (3)
47ContentType = contentType, 71ContentType = new StringSegment("text/plain"), 99ContentType = new StringSegment("text/plain"),
Formatters\OutputFormatterTests.cs (2)
63ContentType = new StringSegment(formatter.SupportedMediaTypes[0].ToString()), 92ContentType = new StringSegment(requestedContentType),
Formatters\StreamOutputFormatterTest.cs (2)
26ContentType = contentTypeHeader, 51ContentType = contentTypeHeader,
Formatters\StringOutputFormatterTests.cs (3)
50context.ContentType = new StringSegment(contentType); 96context.ContentType = new StringSegment("text/plain"); 118context.ContentType = new StringSegment("text/plain");
Formatters\SystemTextJsonOutputFormatterTest.cs (6)
51ContentType = new StringSegment(mediaType.ToString()), 79ContentType = new StringSegment(mediaType.ToString()), 106ContentType = new StringSegment(mediaType.ToString()), 135ContentType = new StringSegment(mediaType.ToString()), 197ContentType = new StringSegment(mediaType.ToString()), 237ContentType = new StringSegment(mediaType.ToString()),
Formatters\TextOutputFormatterTests.cs (8)
59ContentType = new StringSegment(httpRequest.Headers.Accept), 85ContentType = new StringSegment(contentType), 107ContentType = new StringSegment("application/json"), 117formatterContext.ContentType = new StringSegment("application/json"); 138ContentType = new StringSegment("application/json; charset=utf-7"), 164ContentType = new StringSegment(contentType), 195ContentType = testContentType, 224ContentType = testContentType,
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (6)
XmlDataContractSerializerOutputFormatterTest.cs (3)
125context.ContentType = new StringSegment("application/xml"); 384outputFormatterContext.ContentType = new StringSegment("application/xml"); 417outputFormatterContext.ContentType = new StringSegment(mediaType);
XmlSerializerOutputFormatterTest.cs (3)
133context.ContentType = new StringSegment("application/xml"); 357outputFormatterContext.ContentType = new StringSegment("application/xml"); 388outputFormatterContext.ContentType = new StringSegment(mediaType);
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (7)
NewtonsoftJsonOutputFormatterTest.cs (3)
454ContentType = new StringSegment(mediaType.ToString()), 499ContentType = new StringSegment(mediaType.ToString()), 533ContentType = new StringSegment(mediaType.ToString()),
src\Mvc\Mvc.Core\test\Formatters\JsonOutputFormatterTestBase.cs (4)
46ContentType = new StringSegment(mediaType), 97ContentType = new StringSegment(mediaType.ToString()), 129ContentType = new StringSegment(mediaType.ToString()), 190ContentType = new StringSegment(contentType),
36 references to ContentType
Microsoft.AspNetCore.Mvc.Core (11)
Formatters\OutputFormatter.cs (3)
111if (!context.ContentType.HasValue) 120var parsedContentType = new MediaType(context.ContentType); 174response.ContentType = context.ContentType.Value ?? string.Empty;
Formatters\StreamOutputFormatter.cs (2)
35if (context.ContentType != null) 37response.ContentType = context.ContentType.ToString();
Formatters\TextOutputFormatter.cs (3)
81if (context.ContentType.HasValue) 83var parsedContentType = new MediaType(context.ContentType); 107var selectedMediaType = context.ContentType;
Infrastructure\DefaultOutputFormatterSelector.cs (1)
292var contentType = Convert.ToString(context.ContentType, CultureInfo.InvariantCulture);
Infrastructure\ObjectResultExecutor.cs (2)
166if (context.ContentType.HasValue) 168considered.Add(Convert.ToString(context.ContentType, CultureInfo.InvariantCulture));
Microsoft.AspNetCore.Mvc.Core.Test (22)
Formatters\JsonOutputFormatterTestBase.cs (1)
56Assert.Equal(new StringSegment(expectedContentType), outputFormatterContext.ContentType);
Formatters\OutputFormatterTests.cs (2)
29Assert.Equal(formatter.SupportedMediaTypes[0].ToString(), context.ContentType.ToString()); 101Assert.Equal(requestedContentType, context.ContentType.ToString());
Formatters\StringOutputFormatterTests.cs (4)
57Assert.Equal(expectedContentType, context.ContentType); 76Assert.Equal(new StringSegment("text/plain"), context.ContentType); 103Assert.Equal(expectedContentType, context.ContentType); 125Assert.Equal(expectedContentType, context.ContentType);
Formatters\TextOutputFormatterTests.cs (7)
92Assert.Equal(new StringSegment(expectedContentType), formatterContext.ContentType); 115var firstContentType = formatterContext.ContentType; 120var secondContentType = formatterContext.ContentType; 148Assert.Equal(new StringSegment("application/json; charset=utf-8"), formatterContext.ContentType); 174Assert.Same(contentType, formatterContext.ContentType.Buffer); 202Assert.Null(MediaTypeHeaderValue.Parse(context.ContentType.Value).Encoding); 203Assert.Equal(testContentType, context.ContentType);
Infrastructure\DefaultOutputFormatterSelectorTest.cs (7)
43Assert.Equal(new StringSegment("application/json"), context.ContentType); 73Assert.Equal(new StringSegment("application/json"), context.ContentType); 173Assert.Equal(new StringSegment(expectedContentType), context.ContentType); 202Assert.Equal(new StringSegment("application/json"), context.ContentType); 232Assert.Equal(new StringSegment("application/xml"), context.ContentType); 329Assert.Equal(new StringSegment("text/custom2"), context.ContentType); 360Assert.Equal(new StringSegment("text/custom"), context.ContentType);
MvcCoreLoggerExtensionsTest.cs (1)
413context.SetupGet(x => x.ContentType).Returns("application/json");
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (2)
XmlDataContractSerializerOutputFormatterTest.cs (1)
426Assert.Equal(new StringSegment(expectedContentType), outputFormatterContext.ContentType);
XmlSerializerOutputFormatterTest.cs (1)
397Assert.Equal(new StringSegment(expectedContentType), outputFormatterContext.ContentType);
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (1)
src\Mvc\Mvc.Core\test\Formatters\JsonOutputFormatterTestBase.cs (1)
56Assert.Equal(new StringSegment(expectedContentType), outputFormatterContext.ContentType);