37 instantiations of MediaTypeCollection
Microsoft.AspNetCore.Mvc.ApiExplorer (6)
ApiResponseTypeProvider.cs (3)
81var contentTypes = new MediaTypeCollection(); 203var attributeContentTypes = new MediaTypeCollection(); 246var attributeContentTypes = new MediaTypeCollection();
DefaultApiDescriptionProvider.cs (2)
418contentTypes = new MediaTypeCollection 453var contentTypes = new MediaTypeCollection();
EndpointMetadataApiDescriptionProvider.cs (1)
346var contentTypes = new MediaTypeCollection();
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (1)
DefaultApiDescriptionProviderTest.cs (1)
2871public MediaTypeCollection ContentTypes { get; } = new MediaTypeCollection();
Microsoft.AspNetCore.Mvc.Core (9)
ConsumesAttribute.cs (1)
241var contentTypes = new MediaTypeCollection();
Formatters\FormatFilter.cs (1)
84var supportedMediaTypes = new MediaTypeCollection();
Formatters\InputFormatter.cs (1)
19public MediaTypeCollection SupportedMediaTypes { get; } = new MediaTypeCollection();
Formatters\OutputFormatter.cs (1)
19public MediaTypeCollection SupportedMediaTypes { get; } = new MediaTypeCollection();
Infrastructure\DefaultApiProblemDetailsWriter.cs (1)
17private static readonly MediaTypeCollection _problemContentTypes = new()
ObjectResult.cs (1)
26_contentTypes = new MediaTypeCollection();
ProducesAttribute.cs (2)
28ContentTypes = new MediaTypeCollection(); 109var contentTypes = new MediaTypeCollection();
ProducesResponseTypeAttribute.cs (1)
108MediaTypeCollection contentTypes = new();
Microsoft.AspNetCore.Mvc.Core.Test (16)
ConsumesAttributeTests.cs (1)
387var contentTypes = new MediaTypeCollection()
Infrastructure\DefaultOutputFormatterSelectorTest.cs (10)
39new MediaTypeCollection { "application/json" }); 69new MediaTypeCollection { "application/json" }); 98new MediaTypeCollection { "application/json" }); 109var contentTypes = new MediaTypeCollection 198new MediaTypeCollection()); 228new MediaTypeCollection()); 263new MediaTypeCollection()); 292new MediaTypeCollection()); 317var serverDefinedContentTypes = new MediaTypeCollection(); 349var serverDefinedContentTypes = new MediaTypeCollection();
Infrastructure\ObjectResultExecutorTest.cs (1)
337var mediaTypes = new MediaTypeCollection();
MediaTypeCollectionTest.cs (3)
15var collection = new MediaTypeCollection(); 29var collection = new MediaTypeCollection 46var collection = new MediaTypeCollection
MvcCoreLoggerExtensionsTest.cs (1)
404var mediaTypes = new MediaTypeCollection
Microsoft.AspNetCore.OpenApi (5)
Services\OpenApiGenerator.cs (5)
124var discoveredContentTypeAnnotation = new MediaTypeCollection(); 155var discoveredContentTypeAnnotation = new MediaTypeCollection(); 242eligibleAnnotations.Add(StatusCodes.Status200OK, (responseType, new MediaTypeCollection())); 246eligibleAnnotations.Add(StatusCodes.Status200OK, (responseType, new MediaTypeCollection() { "text/plain" })); 250eligibleAnnotations.Add(StatusCodes.Status200OK, (responseType, new MediaTypeCollection() { "application/json" }));
69 references to MediaTypeCollection
Microsoft.AspNetCore.Mvc.ApiExplorer (10)
ApiResponseTypeProvider.cs (5)
81var contentTypes = new MediaTypeCollection(); 138MediaTypeCollection contentTypes, 203var attributeContentTypes = new MediaTypeCollection(); 246var attributeContentTypes = new MediaTypeCollection(); 267internal static void CalculateResponseFormatForType(ApiResponseType apiResponse, MediaTypeCollection declaredContentTypes, IEnumerable<IApiResponseTypeMetadataProvider>? responseTypeMetadataProviders, IModelMetadataProvider? modelMetadataProvider)
DefaultApiDescriptionProvider.cs (4)
129var contentTypes = GetDeclaredContentTypes(requestMetadataAttributes, acceptsMetadata); 414private IReadOnlyList<ApiRequestFormat> GetSupportedFormats(MediaTypeCollection contentTypes, Type type) 451internal static MediaTypeCollection GetDeclaredContentTypes(IReadOnlyList<IApiRequestMetadataProvider>? requestMetadataAttributes, IAcceptsMetadata? acceptsMetadata) 453var contentTypes = new MediaTypeCollection();
EndpointMetadataApiDescriptionProvider.cs (1)
346var contentTypes = new MediaTypeCollection();
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (2)
DefaultApiDescriptionProviderTest.cs (2)
2871public MediaTypeCollection ContentTypes { get; } = new MediaTypeCollection(); 2877public void SetContentTypes(MediaTypeCollection contentTypes)
Microsoft.AspNetCore.Mvc.Core (39)
ApiExplorer\IApiRequestMetadataProvider.cs (2)
17/// <param name="contentTypes">The <see cref="MediaTypeCollection"/></param> 18void SetContentTypes(MediaTypeCollection contentTypes);
ApiExplorer\IApiResponseMetadataProvider.cs (1)
28void SetContentTypes(MediaTypeCollection contentTypes);
ConsumesAttribute.cs (4)
89public MediaTypeCollection ContentTypes { get; set; } 236private static MediaTypeCollection GetContentTypes(string firstArg, string[] args) 241var contentTypes = new MediaTypeCollection(); 269public void SetContentTypes(MediaTypeCollection contentTypes)
Formatters\FormatFilter.cs (3)
84var supportedMediaTypes = new MediaTypeCollection(); 108private static bool IsSuperSetOfAnySupportedMediaType(string contentType, MediaTypeCollection supportedMediaTypes) 176public static partial void ActionDoesNotSupportFormatFilterContentType(ILogger logger, string formatFilterContentType, MediaTypeCollection supportedMediaTypes);
Formatters\InputFormatter.cs (1)
19public MediaTypeCollection SupportedMediaTypes { get; } = new MediaTypeCollection();
Formatters\MediaTypeCollection.cs (5)
15/// Adds an object to the end of the <see cref="MediaTypeCollection"/>. 17/// <param name="item">The media type to be added to the end of the <see cref="MediaTypeCollection"/>.</param> 26/// Inserts an element into the <see cref="MediaTypeCollection"/> at the specified index. 43/// Removes the first occurrence of a specific media type from the <see cref="MediaTypeCollection"/>. 48/// <see cref="MediaTypeCollection"/>.</returns>
Formatters\OutputFormatter.cs (1)
19public MediaTypeCollection SupportedMediaTypes { get; } = new MediaTypeCollection();
Infrastructure\DefaultApiProblemDetailsWriter.cs (1)
17private static readonly MediaTypeCollection _problemContentTypes = new()
Infrastructure\DefaultOutputFormatterSelector.cs (6)
50public override IOutputFormatter? SelectFormatter(OutputFormatterCanWriteContext context, IList<IOutputFormatter> formatters, MediaTypeCollection contentTypes) 216MediaTypeCollection acceptableContentTypes) 239MediaTypeCollection possibleOutputContentTypes) 266private static void ValidateContentTypes(MediaTypeCollection contentTypes) 310public static partial void SelectingOutputFormatterUsingAcceptHeaderAndExplicitContentTypes(ILogger logger, IEnumerable<MediaTypeSegmentWithQuality> acceptHeader, MediaTypeCollection explicitContentTypes); 316public static partial void SelectingOutputFormatterUsingContentTypes(ILogger logger, MediaTypeCollection explicitContentTypes);
Infrastructure\ObjectResultExecutor.cs (1)
160public static void NoFormatter(ILogger logger, OutputFormatterCanWriteContext context, MediaTypeCollection contentTypes)
Infrastructure\OutputFormatterSelector.cs (1)
33public abstract IOutputFormatter? SelectFormatter(OutputFormatterCanWriteContext context, IList<IOutputFormatter> formatters, MediaTypeCollection mediaTypes);
ObjectResult.cs (3)
16private MediaTypeCollection _contentTypes; 41/// Gets or sets the <see cref="MediaTypeCollection"/>. 43public MediaTypeCollection ContentTypes
ProducesAttribute.cs (4)
58public MediaTypeCollection ContentTypes { get; set; } 95public void SetContentTypes(MediaTypeCollection contentTypes) 104private static MediaTypeCollection GetContentTypes(string firstArg, string[] args) 109var contentTypes = new MediaTypeCollection();
ProducesDefaultResponseTypeAttribute.cs (1)
43void IApiResponseMetadataProvider.SetContentTypes(MediaTypeCollection contentTypes)
ProducesResponseTypeAttribute.cs (5)
17private readonly MediaTypeCollection? _contentTypes; 88internal MediaTypeCollection? ContentTypes => _contentTypes; 91void IApiResponseMetadataProvider.SetContentTypes(MediaTypeCollection contentTypes) 103private static MediaTypeCollection GetContentTypes(string contentType, string[] additionalContentTypes) 108MediaTypeCollection contentTypes = new();
Microsoft.AspNetCore.Mvc.Core.Test (12)
ConsumesAttributeTests.cs (1)
387var contentTypes = new MediaTypeCollection()
Infrastructure\DefaultOutputFormatterSelectorTest.cs (6)
105public static TheoryData<MediaTypeCollection, string, string> ContentTypes 109var contentTypes = new MediaTypeCollection 116return new TheoryData<MediaTypeCollection, string, string>() 145MediaTypeCollection contentTypes, 317var serverDefinedContentTypes = new MediaTypeCollection(); 349var serverDefinedContentTypes = new MediaTypeCollection();
Infrastructure\ObjectResultExecutorTest.cs (1)
337var mediaTypes = new MediaTypeCollection();
MediaTypeCollectionTest.cs (3)
15var collection = new MediaTypeCollection(); 29var collection = new MediaTypeCollection 46var collection = new MediaTypeCollection
MvcCoreLoggerExtensionsTest.cs (1)
404var mediaTypes = new MediaTypeCollection
Microsoft.AspNetCore.OpenApi (5)
Services\OpenApiGenerator.cs (5)
117var eligibileAnnotations = new Dictionary<int, (Type?, MediaTypeCollection)>(); 124var discoveredContentTypeAnnotation = new MediaTypeCollection(); 155var discoveredContentTypeAnnotation = new MediaTypeCollection(); 219private static void GenerateDefaultContent(MediaTypeCollection discoveredContentTypeAnnotation, Type? discoveredTypeAnnotation) 238private static void GenerateDefaultResponses(Dictionary<int, (Type?, MediaTypeCollection)> eligibleAnnotations, Type responseType)
Mvc.Api.Analyzers.Test (1)
TestFiles\SymbolApiResponseMetadataProviderTest\GetResponseMetadataTests.cs (1)
63public void SetContentTypes(MediaTypeCollection contentTypes)