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