3 implementations of IInputFormatter
Microsoft.AspNetCore.Mvc.Core (1)
Formatters\InputFormatter.cs (1)
13public abstract class InputFormatter : IInputFormatter, IApiRequestFormatMetadataProvider
Microsoft.AspNetCore.Mvc.Core.Test (2)
ModelBinding\Binders\BodyModelBinderProviderTest.cs (1)
149private class TestInputFormatter : IInputFormatter
ModelBinding\Binders\BodyModelBinderTests.cs (1)
747private class TestInputFormatter : IInputFormatter
90 references to IInputFormatter
Microsoft.AspNetCore.Mvc.Abstractions (23)
ApiExplorer\ApiRequestFormat.cs (1)
16public IInputFormatter Formatter { get; set; } = default!;
Formatters\IInputFormatter.cs (2)
12/// Determines whether this <see cref="IInputFormatter"/> can deserialize an object of the 17/// <c>true</c> if this <see cref="IInputFormatter"/> can deserialize an object of the
Formatters\IInputFormatterExceptionPolicy.cs (2)
7/// A policy which <see cref="IInputFormatter"/>s can implement to indicate if they want the body model binder 8/// to handle all exceptions. By default, all default <see cref="IInputFormatter"/>s implement this interface and
Formatters\InputFormatterException.cs (1)
7/// Exception thrown by <see cref="IInputFormatter"/> when the input is not in an expected format.
Formatters\InputFormatterExceptionPolicy.cs (3)
8/// thrown by an <see cref="IInputFormatter"/>. <seealso cref="IInputFormatterExceptionPolicy"/> 12/// An <see cref="IInputFormatter"/> could throw an exception for several reasons, including: 37/// This value indicates that all exceptions thrown by an <see cref="IInputFormatter"/> will be treated
Formatters\InputFormatterResult.cs (14)
7/// Result of a <see cref="IInputFormatter.ReadAsync"/> operation. 28/// Gets an indication whether the <see cref="IInputFormatter.ReadAsync"/> operation had an error. 46/// Returns an <see cref="InputFormatterResult"/> indicating the <see cref="IInputFormatter.ReadAsync"/> 50/// An <see cref="InputFormatterResult"/> indicating the <see cref="IInputFormatter.ReadAsync"/> 60/// the <see cref="IInputFormatter.ReadAsync"/> operation failed. 64/// <see cref="IInputFormatter.ReadAsync"/> operation failed i.e. with <see cref="HasError"/> <c>true</c>. 72/// Returns an <see cref="InputFormatterResult"/> indicating the <see cref="IInputFormatter.ReadAsync"/> 77/// An <see cref="InputFormatterResult"/> indicating the <see cref="IInputFormatter.ReadAsync"/> 87/// the <see cref="IInputFormatter.ReadAsync"/> operation was successful. 92/// <see cref="IInputFormatter.ReadAsync"/> operation succeeded i.e. with <see cref="HasError"/> <c>false</c>. 100/// Returns an <see cref="InputFormatterResult"/> indicating the <see cref="IInputFormatter.ReadAsync"/> 104/// An <see cref="InputFormatterResult"/> indicating the <see cref="IInputFormatter.ReadAsync"/> 114/// the <see cref="IInputFormatter.ReadAsync"/> operation produced no value. 118/// <see cref="IInputFormatter.ReadAsync"/> operation produced no value.
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
DefaultApiDescriptionProvider.cs (1)
427foreach (var formatter in _mvcOptions.InputFormatters)
Microsoft.AspNetCore.Mvc.Core (29)
ApiExplorer\IApiRequestFormatMetadataProvider.cs (3)
10/// An <see cref="Formatters.IInputFormatter"/> should implement this interface to expose metadata information 16/// Gets a filtered list of content types which are supported by the <see cref="Formatters.IInputFormatter"/> 26/// <returns>Content types which are supported by the <see cref="Formatters.IInputFormatter"/>.</returns>
ModelBinding\Binders\BodyModelBinder.cs (15)
17/// An <see cref="IModelBinder"/> which binds models from the request body using an <see cref="IInputFormatter"/> 22private readonly IList<IInputFormatter> _formatters; 30/// <param name="formatters">The list of <see cref="IInputFormatter"/>.</param> 35public BodyModelBinder(IList<IInputFormatter> formatters, IHttpRequestStreamReaderFactory readerFactory) 43/// <param name="formatters">The list of <see cref="IInputFormatter"/>.</param> 50IList<IInputFormatter> formatters, 60/// <param name="formatters">The list of <see cref="IInputFormatter"/>.</param> 68IList<IInputFormatter> formatters, 116var formatter = (IInputFormatter?)null; 191private static bool ShouldHandleException(IInputFormatter formatter) 202public static void InputFormatterSelected(ILogger logger, IInputFormatter inputFormatter, InputFormatterContext formatterContext) 212private static partial void InputFormatterSelected(ILogger logger, IInputFormatter inputFormatter, string? contentType); 214public static void InputFormatterRejected(ILogger logger, IInputFormatter inputFormatter, InputFormatterContext formatterContext) 224private static partial void InputFormatterRejected(ILogger logger, IInputFormatter inputFormatter, string? contentType);
ModelBinding\Binders\BodyModelBinderProvider.cs (8)
19private readonly IList<IInputFormatter> _formatters; 27/// <param name="formatters">The list of <see cref="IInputFormatter"/>.</param> 29public BodyModelBinderProvider(IList<IInputFormatter> formatters, IHttpRequestStreamReaderFactory readerFactory) 37/// <param name="formatters">The list of <see cref="IInputFormatter"/>.</param> 40public BodyModelBinderProvider(IList<IInputFormatter> formatters, IHttpRequestStreamReaderFactory readerFactory, ILoggerFactory loggerFactory) 48/// <param name="formatters">The list of <see cref="IInputFormatter"/>.</param> 53IList<IInputFormatter> formatters, 80typeof(IInputFormatter).FullName));
MvcOptions.cs (3)
44InputFormatters = new FormatterCollection<IInputFormatter>(); 99/// Gets a list of <see cref="IInputFormatter"/>s that are used by this application. 101public FormatterCollection<IInputFormatter> InputFormatters { get; }
Microsoft.AspNetCore.Mvc.Core.Test (37)
Controllers\ControllerBinderDelegateProviderTest.cs (1)
1134var modelBinderProvider = new BodyModelBinderProvider(new[] { Mock.Of<IInputFormatter>() }, Mock.Of<IHttpRequestStreamReaderFactory>());
ModelBinding\Binders\BodyModelBinderProviderTest.cs (4)
46$"At least one '{typeof(IInputFormatter).FullName}' is required to bind from the body."; 78var formatterList = new List<IInputFormatter> { formatter }; 132private static BodyModelBinderProvider CreateProvider(params IInputFormatter[] formatters) 137new List<IInputFormatter>(formatters),
ModelBinding\Binders\BodyModelBinderTests.cs (32)
24var mockInputFormatter = new Mock<IInputFormatter>(); 31var inputFormatter = mockInputFormatter.Object; 60var binder = CreateBinder(new List<IInputFormatter>()); 85var binder = CreateBinder(new List<IInputFormatter>()); 109var binder = CreateBinder(new List<IInputFormatter>()); 122var mockInputFormatter = new Mock<IInputFormatter>(); 127var inputFormatter = mockInputFormatter.Object; 164var mockInputFormatter = new Mock<IInputFormatter>(); 170var inputFormatter = mockInputFormatter.Object; 195var mockInputFormatter = new Mock<IInputFormatter>(); 198var inputFormatter = mockInputFormatter.Object; 223var mockInputFormatter = new Mock<IInputFormatter>(); 226var inputFormatter = mockInputFormatter.Object; 282public static TheoryData<IInputFormatter> BuiltInFormattersThrowingInputFormatterException 286return new TheoryData<IInputFormatter>() 297IInputFormatter formatter) 354public static TheoryData<IInputFormatter> DerivedFormattersThrowingInputFormatterException 358return new TheoryData<IInputFormatter>() 368public async Task BindModel_DerivedXmlInputFormatters_AddsErrorToModelState(IInputFormatter formatter) 427public static TheoryData<IInputFormatter, string> BuiltInFormattersThrowingNonInputFormatterException 431return new TheoryData<IInputFormatter, string>() 443IInputFormatter formatter, 462public static TheoryData<IInputFormatter, string> DerivedInputFormattersThrowingNonInputFormatterException 466return new TheoryData<IInputFormatter, string>() 478IInputFormatter formatter, 546var binder = CreateBinder(new List<IInputFormatter>()); 568var inputFormatters = new List<IInputFormatter>() 595var inputFormatters = new List<IInputFormatter>() 624var inputFormatters = new List<IInputFormatter>() 668var binder = new BodyModelBinder(new List<IInputFormatter>(), new TestHttpRequestStreamReaderFactory()); 707private static BodyModelBinder CreateBinder(IList<IInputFormatter> formatters, bool treatEmptyInputAsDefaultValueOption = false) 716private static BodyModelBinder CreateBinder(IList<IInputFormatter> formatters, MvcOptions mvcOptions)