8 writes to ContentTypes
Microsoft.AspNetCore.Mvc.Core (1)
Infrastructure\ProblemDetailsClientErrorFactory.cs (1)
22ContentTypes =
Microsoft.AspNetCore.Mvc.Core.Test (5)
Infrastructure\ObjectResultExecutorTest.cs (5)
31ContentTypes = { "text/xml", }, 124ContentTypes = { "text/plain" }, // This will not be used 194ContentTypes = { "text/plain" }, // This will not be used 219ContentTypes = { "text/plain" }, // This will not be used 343result.ContentTypes = mediaTypes;
Mvc.Api.Analyzers.Test (2)
TestFiles\AddResponseTypeAttributeCodeFixProviderIntegrationTest\CodeFixAddsStatusCodesFromObjectInitializer.Input.cs (1)
46ContentTypes = { "application/json" },
TestFiles\AddResponseTypeAttributeCodeFixProviderIntegrationTest\CodeFixAddsStatusCodesFromObjectInitializer.Output.cs (1)
52ContentTypes = { "application/json" },
41 references to ContentTypes
BasicWebSite (2)
StartupWithCustomInvalidModelStateFactory.cs (2)
26result.ContentTypes.Clear(); 27result.ContentTypes.Add("application/vnd.error+json");
Microsoft.AspNetCore.Mvc.Core (16)
DependencyInjection\ApiBehaviorOptionsSetup.cs (2)
46result.ContentTypes.Add("application/problem+json"); 47result.ContentTypes.Add("application/problem+xml");
Formatters\FormatFilter.cs (3)
150if (objectResult.ContentTypes.Count == 1 || 158objectResult.ContentTypes.Clear(); 161objectResult.ContentTypes.Add(contentType);
Infrastructure\DefaultOutputFormatterSelector.cs (1)
277nameof(ObjectResult.ContentTypes));
Infrastructure\ObjectResultExecutor.cs (7)
94result.ContentTypes); 99Log.NoFormatter(Logger, formatterContext, result.ContentTypes); 124Debug.Assert(result.ContentTypes != null); 129if (result.ContentTypes.Count == 0 && !string.IsNullOrEmpty(responseContentType)) 131result.ContentTypes.Add(responseContentType); 136result.ContentTypes.Add("application/problem+json"); 137result.ContentTypes.Add("application/problem+xml");
ProducesAttribute.cs (3)
16/// <see cref="ObjectResult.ContentTypes"/>. 59/// Gets or sets the supported response content types. Used to set <see cref="ObjectResult.ContentTypes"/>. 88SetContentTypes(objectResult.ContentTypes);
Microsoft.AspNetCore.Mvc.Core.Test (23)
DependencyInjection\ApiBehaviorOptionsSetupTest.cs (3)
42Assert.Equal(new[] { "application/problem+json", "application/problem+xml" }, badRequest.ContentTypes.OrderBy(c => c)); 64Assert.Equal(new[] { "application/problem+json", "application/problem+xml" }, badRequest.ContentTypes.OrderBy(c => c)); 88Assert.Equal(new[] { "application/problem+json", "application/problem+xml" }, objectResult.ContentTypes.OrderBy(c => c));
Formatters\FormatFilterTest.cs (10)
53Assert.Single(objectResult.ContentTypes); 54MediaTypeAssert.Equal(mediaType, objectResult.ContentTypes[0]); 97Assert.Single(objectResult.ContentTypes); 98MediaTypeAssert.Equal(mediaType, objectResult.ContentTypes[0]); 129Assert.Single(objectResult.ContentTypes); 130MediaTypeAssert.Equal(mediaType, objectResult.ContentTypes[0]); 332objectResult.ContentTypes.Add(new MediaTypeHeaderValue("application/foo")); 352Assert.Single(result.ContentTypes); 353MediaTypeAssert.Equal(mediaType, result.ContentTypes[0]); 387Assert.Empty(result.ContentTypes);
Infrastructure\ProblemDetalsClientErrorFactoryTest.cs (4)
31Assert.Equal(new[] { "application/problem+json", "application/problem+xml" }, objectResult.ContentTypes); 58Assert.Equal(new[] { "application/problem+json", "application/problem+xml" }, objectResult.ContentTypes); 88Assert.Equal(new[] { "application/problem+json", "application/problem+xml" }, objectResult.ContentTypes); 114Assert.Equal(new[] { "application/problem+json", "application/problem+xml" }, objectResult.ContentTypes);
ObjectResultTests.cs (1)
28Assert.Empty(result.ContentTypes);
ProducesAttributeTests.cs (5)
32Assert.Equal(2, objectResult.ContentTypes.Count); 33MediaTypeAssert.Equal(mediaType1, objectResult.ContentTypes[0]); 34MediaTypeAssert.Equal(mediaType2, objectResult.ContentTypes[1]); 59Assert.Single(objectResult.ContentTypes); 84Assert.Empty(objectResult.ContentTypes);