37 instantiations of MediaTypeCollection
Microsoft.AspNetCore.Mvc.ApiExplorer (6)
ApiResponseTypeProvider.cs (3)
81var contentTypes = new MediaTypeCollection(); 209var attributeContentTypes = new MediaTypeCollection(); 259var attributeContentTypes = new MediaTypeCollection();
DefaultApiDescriptionProvider.cs (2)
421contentTypes = new MediaTypeCollection 456var contentTypes = new MediaTypeCollection();
EndpointMetadataApiDescriptionProvider.cs (1)
333var contentTypes = new MediaTypeCollection();
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (1)
DefaultApiDescriptionProviderTest.cs (1)
2873public 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(); 112var contentTypes = new MediaTypeCollection();
ProducesResponseTypeAttribute.cs (1)
113MediaTypeCollection 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)
125var discoveredContentTypeAnnotation = new MediaTypeCollection(); 156var discoveredContentTypeAnnotation = new MediaTypeCollection(); 243eligibleAnnotations.Add(StatusCodes.Status200OK, (responseType, new MediaTypeCollection())); 247eligibleAnnotations.Add(StatusCodes.Status200OK, (responseType, new MediaTypeCollection() { "text/plain" })); 251eligibleAnnotations.Add(StatusCodes.Status200OK, (responseType, new MediaTypeCollection() { "application/json" }));
69 references to MediaTypeCollection
Microsoft.AspNetCore.Mvc.ApiExplorer (10)
ApiResponseTypeProvider.cs (5)
81var contentTypes = new MediaTypeCollection(); 139MediaTypeCollection contentTypes, 209var attributeContentTypes = new MediaTypeCollection(); 259var attributeContentTypes = new MediaTypeCollection(); 280internal static void CalculateResponseFormatForType(ApiResponseType apiResponse, MediaTypeCollection declaredContentTypes, IEnumerable<IApiResponseTypeMetadataProvider>? responseTypeMetadataProviders, IModelMetadataProvider? modelMetadataProvider)
DefaultApiDescriptionProvider.cs (4)
132var contentTypes = GetDeclaredContentTypes(requestMetadataAttributes, acceptsMetadata); 417private IReadOnlyList<ApiRequestFormat> GetSupportedFormats(MediaTypeCollection contentTypes, Type type) 454internal static MediaTypeCollection GetDeclaredContentTypes(IReadOnlyList<IApiRequestMetadataProvider>? requestMetadataAttributes, IAcceptsMetadata? acceptsMetadata) 456var contentTypes = new MediaTypeCollection();
EndpointMetadataApiDescriptionProvider.cs (1)
333var contentTypes = new MediaTypeCollection();
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (2)
DefaultApiDescriptionProviderTest.cs (2)
2873public MediaTypeCollection ContentTypes { get; } = new MediaTypeCollection(); 2881public 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)
33void 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)
61public MediaTypeCollection ContentTypes { get; set; } 98public void SetContentTypes(MediaTypeCollection contentTypes) 107private static MediaTypeCollection GetContentTypes(string firstArg, string[] args) 112var contentTypes = new MediaTypeCollection();
ProducesDefaultResponseTypeAttribute.cs (1)
48void IApiResponseMetadataProvider.SetContentTypes(MediaTypeCollection contentTypes)
ProducesResponseTypeAttribute.cs (5)
17private readonly MediaTypeCollection? _contentTypes; 88internal MediaTypeCollection? ContentTypes => _contentTypes; 96void IApiResponseMetadataProvider.SetContentTypes(MediaTypeCollection contentTypes) 108private static MediaTypeCollection GetContentTypes(string contentType, string[] additionalContentTypes) 113MediaTypeCollection 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)
118var eligibileAnnotations = new Dictionary<int, (Type?, MediaTypeCollection)>(); 125var discoveredContentTypeAnnotation = new MediaTypeCollection(); 156var discoveredContentTypeAnnotation = new MediaTypeCollection(); 220private static void GenerateDefaultContent(MediaTypeCollection discoveredContentTypeAnnotation, Type? discoveredTypeAnnotation) 239private static void GenerateDefaultResponses(Dictionary<int, (Type?, MediaTypeCollection)> eligibleAnnotations, Type responseType)
Mvc.Api.Analyzers.Test (1)
TestFiles\SymbolApiResponseMetadataProviderTest\GetResponseMetadataTests.cs (1)
65public void SetContentTypes(MediaTypeCollection contentTypes)