7 implementations of IOutputFormatter
Microsoft.AspNetCore.Mvc.Core (3)
Formatters\HttpNoContentOutputFormatter.cs (1)
11public class HttpNoContentOutputFormatter : IOutputFormatter
Formatters\OutputFormatter.cs (1)
13public abstract class OutputFormatter : IOutputFormatter, IApiResponseTypeMetadataProvider
Formatters\StreamOutputFormatter.cs (1)
10public class StreamOutputFormatter : IOutputFormatter
Microsoft.AspNetCore.Mvc.Core.Test (4)
Infrastructure\DefaultApiProblemDetailsWriterTest.cs (1)
239private class TestFormatter : IOutputFormatter
Infrastructure\DefaultOutputFormatterSelectorTest.cs (1)
379private class CannotWriteFormatter : IOutputFormatter
Infrastructure\ObjectResultExecutorTest.cs (1)
485private class CannotWriteFormatter : IOutputFormatter
ObjectResultTests.cs (1)
170private class NoOpOutputFormatter : IOutputFormatter
108 references to IOutputFormatter
BasicWebSite (2)
Controllers\ContentNegotiation\FallbackOnTypeBasedMatchController.cs (2)
64foreach (var formatter in _mvcOptions.Value.OutputFormatters) 77foreach (var formatter in optionsAccessor.Value.OutputFormatters)
Microsoft.AspNetCore.Mvc.Abstractions (8)
ApiExplorer\ApiResponseFormat.cs (1)
16public IOutputFormatter Formatter { get; set; } = default!;
Formatters\IOutputFormatter.cs (1)
12/// Determines whether this <see cref="IOutputFormatter"/> can serialize
Formatters\OutputFormatterCanWriteContext.cs (5)
10/// A context object for <see cref="IOutputFormatter.CanWriteResult(OutputFormatterCanWriteContext)"/>. 34/// An <see cref="IOutputFormatter"/> can set this value when its 35/// <see cref="IOutputFormatter.CanWriteResult(OutputFormatterCanWriteContext)"/> method is called, 37/// <see cref="IOutputFormatter.WriteAsync(OutputFormatterWriteContext)"/> 43/// This allows <see cref="IOutputFormatter.CanWriteResult(OutputFormatterCanWriteContext)"/> to
Formatters\OutputFormatterWriteContext.cs (1)
10/// A context object for <see cref="IOutputFormatter.WriteAsync(OutputFormatterWriteContext)"/>.
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
ApiResponseTypeProvider.cs (1)
329Formatter = (IOutputFormatter)responseTypeMetadataProvider,
Microsoft.AspNetCore.Mvc.Core (40)
ApiExplorer\IApiResponseTypeMetadataProvider.cs (3)
10/// An <see cref="Formatters.IOutputFormatter"/> should implement this interface to expose metadata information 16/// Gets a filtered list of content types which are supported by the <see cref="Formatters.IOutputFormatter"/> 26/// <returns>Content types which are supported by the <see cref="Formatters.IOutputFormatter"/>.</returns>
Infrastructure\DefaultApiProblemDetailsWriter.cs (2)
78var selectedFormatter = _formatterSelector.SelectFormatter( 80Array.Empty<IOutputFormatter>(),
Infrastructure\DefaultOutputFormatterSelector.cs (21)
28private readonly IList<IOutputFormatter> _formatters; 44_formatters = new ReadOnlyCollection<IOutputFormatter>(options.Value.OutputFormatters); 50public override IOutputFormatter? SelectFormatter(OutputFormatterCanWriteContext context, IList<IOutputFormatter> formatters, MediaTypeCollection contentTypes) 66typeof(IOutputFormatter).FullName)); 76IOutputFormatter? selectedFormatter = null; 168private IOutputFormatter? SelectFormatterNotUsingContentType( 170IList<IOutputFormatter> formatters) 174foreach (var formatter in formatters) 188private static IOutputFormatter? SelectFormatterUsingSortedAcceptHeaders( 190IList<IOutputFormatter> formatters, 202var formatter = formatters[j]; 213private static IOutputFormatter? SelectFormatterUsingAnyAcceptableContentType( 215IList<IOutputFormatter> formatters, 218foreach (var formatter in formatters) 235private static IOutputFormatter? SelectFormatterUsingSortedAcceptHeadersAndContentTypes( 237IList<IOutputFormatter> formatters, 251var formatter = formatters[k]; 287IOutputFormatter outputFormatter, 298public static partial void FormatterSelected(ILogger logger, IOutputFormatter outputFormatter, string? contentType); 322public static partial void RegisteredOutputFormatters(ILogger logger, IEnumerable<IOutputFormatter> outputFormatters);
Infrastructure\ObjectResultExecutor.cs (3)
91var selectedFormatter = FormatterSelector.SelectFormatter( 93(IList<IOutputFormatter>)result.Formatters ?? Array.Empty<IOutputFormatter>(),
Infrastructure\OutputFormatterSelector.cs (5)
9/// Selects an <see cref="IOutputFormatter"/> to write a response to the current request. 27/// Selects an <see cref="IOutputFormatter"/> to write the response based on the provided values and the current request. 32/// <returns>The selected <see cref="IOutputFormatter"/>, or <c>null</c> if one could not be selected.</returns> 33public abstract IOutputFormatter? SelectFormatter(OutputFormatterCanWriteContext context, IList<IOutputFormatter> formatters, MediaTypeCollection mediaTypes);
MvcOptions.cs (3)
45OutputFormatters = new FormatterCollection<IOutputFormatter>(); 195/// Gets a list of <see cref="IOutputFormatter"/>s that are used by this application. 197public FormatterCollection<IOutputFormatter> OutputFormatters { get; }
ObjectResult.cs (3)
25Formatters = new FormatterCollection<IOutputFormatter>(); 36/// The collection of <see cref="IOutputFormatter"/>. 38public FormatterCollection<IOutputFormatter> Formatters { get; set; }
Microsoft.AspNetCore.Mvc.Core.Test (56)
AcceptedAtActionResultTests.cs (4)
248private static HttpContext GetHttpContext(Mock<IOutputFormatter> formatter) 255private static Mock<IOutputFormatter> CreateMockFormatter() 257var formatter = new Mock<IOutputFormatter> 266private static IServiceProvider CreateServices(Mock<IOutputFormatter> formatter)
AcceptedAtRouteResultTests.cs (4)
156private static HttpContext GetHttpContext(Mock<IOutputFormatter> formatter) 163private static Mock<IOutputFormatter> CreateMockFormatter() 165var formatter = new Mock<IOutputFormatter> 174private static IServiceProvider CreateServices(Mock<IOutputFormatter> formatter)
AcceptedResultTests.cs (4)
113private static HttpContext GetHttpContext(Mock<IOutputFormatter> formatter) 120private static Mock<IOutputFormatter> CreateMockFormatter() 122var formatter = new Mock<IOutputFormatter> 131private static IServiceProvider CreateServices(Mock<IOutputFormatter> formatter)
Formatters\FormatterCollectionTest.cs (4)
14var collection = new FormatterCollection<IOutputFormatter> 25var formatter = Assert.Single(collection); 33var collection = new FormatterCollection<IOutputFormatter> 44var formatter = Assert.Single(collection);
Infrastructure\ControllerActionInvokerTest.cs (1)
1719var formatter = new Mock<IOutputFormatter>();
Infrastructure\DefaultApiProblemDetailsWriterTest.cs (2)
187var formatter = new Mock<IOutputFormatter>(); 224private static DefaultApiProblemDetailsWriter GetWriter(ApiBehaviorOptions options = null, IOutputFormatter formatter = null)
Infrastructure\DefaultOutputFormatterSelectorTest.cs (31)
20var formatters = new List<IOutputFormatter> 25var selector = CreateSelector(new IOutputFormatter[] { }); 36var formatter = selector.SelectFormatter( 50var formatters = new List<IOutputFormatter> 66var formatter = selector.SelectFormatter( 68Array.Empty<IOutputFormatter>(), 80var formatters = new List<IOutputFormatter> 95var formatter = selector.SelectFormatter( 97Array.Empty<IOutputFormatter>(), 150var formatters = new List<IOutputFormatter> 166var formatter = selector.SelectFormatter( 168Array.Empty<IOutputFormatter>(), 180var formatters = new List<IOutputFormatter> 195var formatter = selector.SelectFormatter( 197Array.Empty<IOutputFormatter>(), 209var formatters = new List<IOutputFormatter> 225var formatter = selector.SelectFormatter( 227Array.Empty<IOutputFormatter>(), 260var formatter = selector.SelectFormatter( 262Array.Empty<IOutputFormatter>(), 273var formatters = new List<IOutputFormatter> 289var formatter = selector.SelectFormatter( 291Array.Empty<IOutputFormatter>(), 302var formatters = new List<IOutputFormatter> 322var formatter = selector.SelectFormatter( 324Array.Empty<IOutputFormatter>(), 336var formatters = new List<IOutputFormatter> 353var formatter = selector.SelectFormatter( 355Array.Empty<IOutputFormatter>(), 363private static DefaultOutputFormatterSelector CreateSelector(IEnumerable<IOutputFormatter> formatters) 366foreach (var formatter in formatters)
Infrastructure\ObjectResultExecutorTest.cs (2)
267result.Formatters = new FormatterCollection<IOutputFormatter> 309$"empty. At least one '{typeof(IOutputFormatter).FullName}' is required to format a response.";
ObjectResultTests.cs (4)
41Formatters = new FormatterCollection<IOutputFormatter>() 73Formatters = new FormatterCollection<IOutputFormatter>() 102Formatters = new FormatterCollection<IOutputFormatter>() 133Formatters = new FormatterCollection<IOutputFormatter>()
Microsoft.AspNetCore.Mvc.NewtonsoftJson (1)
NewtonsoftJsonOutputFormatter.cs (1)
126/// <param name="context">A context object for <see cref="IOutputFormatter.WriteAsync(OutputFormatterWriteContext)"/>.</param>