3 implementations of IInputFormatter
Microsoft.AspNetCore.Mvc.Core (1)
Formatters\InputFormatter.cs (1)
13
public abstract class InputFormatter :
IInputFormatter
, IApiRequestFormatMetadataProvider
Microsoft.AspNetCore.Mvc.Core.Test (2)
ModelBinding\Binders\BodyModelBinderProviderTest.cs (1)
149
private class TestInputFormatter :
IInputFormatter
ModelBinding\Binders\BodyModelBinderTests.cs (1)
747
private class TestInputFormatter :
IInputFormatter
90 references to IInputFormatter
Microsoft.AspNetCore.Mvc.Abstractions (23)
ApiExplorer\ApiRequestFormat.cs (1)
16
public
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)
430
foreach (
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
"/>
22
private readonly IList<
IInputFormatter
> _formatters;
30
/// <param name="formatters">The list of <see cref="
IInputFormatter
"/>.</param>
35
public BodyModelBinder(IList<
IInputFormatter
> formatters, IHttpRequestStreamReaderFactory readerFactory)
43
/// <param name="formatters">The list of <see cref="
IInputFormatter
"/>.</param>
50
IList<
IInputFormatter
> formatters,
60
/// <param name="formatters">The list of <see cref="
IInputFormatter
"/>.</param>
68
IList<
IInputFormatter
> formatters,
116
var
formatter = (
IInputFormatter
?)null;
191
private static bool ShouldHandleException(
IInputFormatter
formatter)
202
public static void InputFormatterSelected(ILogger logger,
IInputFormatter
inputFormatter, InputFormatterContext formatterContext)
212
private static partial void InputFormatterSelected(ILogger logger,
IInputFormatter
inputFormatter, string? contentType);
214
public static void InputFormatterRejected(ILogger logger,
IInputFormatter
inputFormatter, InputFormatterContext formatterContext)
224
private static partial void InputFormatterRejected(ILogger logger,
IInputFormatter
inputFormatter, string? contentType);
ModelBinding\Binders\BodyModelBinderProvider.cs (8)
19
private readonly IList<
IInputFormatter
> _formatters;
27
/// <param name="formatters">The list of <see cref="
IInputFormatter
"/>.</param>
29
public BodyModelBinderProvider(IList<
IInputFormatter
> formatters, IHttpRequestStreamReaderFactory readerFactory)
37
/// <param name="formatters">The list of <see cref="
IInputFormatter
"/>.</param>
40
public BodyModelBinderProvider(IList<
IInputFormatter
> formatters, IHttpRequestStreamReaderFactory readerFactory, ILoggerFactory loggerFactory)
48
/// <param name="formatters">The list of <see cref="
IInputFormatter
"/>.</param>
53
IList<
IInputFormatter
> formatters,
80
typeof(
IInputFormatter
).FullName));
MvcOptions.cs (3)
44
InputFormatters = new FormatterCollection<
IInputFormatter
>();
99
/// Gets a list of <see cref="
IInputFormatter
"/>s that are used by this application.
101
public FormatterCollection<
IInputFormatter
> InputFormatters { get; }
Microsoft.AspNetCore.Mvc.Core.Test (37)
Controllers\ControllerBinderDelegateProviderTest.cs (1)
1134
var 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.";
78
var formatterList = new List<
IInputFormatter
> { formatter };
132
private static BodyModelBinderProvider CreateProvider(params
IInputFormatter
[] formatters)
137
new List<
IInputFormatter
>(formatters),
ModelBinding\Binders\BodyModelBinderTests.cs (32)
24
var mockInputFormatter = new Mock<
IInputFormatter
>();
31
var
inputFormatter = mockInputFormatter.Object;
60
var binder = CreateBinder(new List<
IInputFormatter
>());
85
var binder = CreateBinder(new List<
IInputFormatter
>());
109
var binder = CreateBinder(new List<
IInputFormatter
>());
122
var mockInputFormatter = new Mock<
IInputFormatter
>();
127
var
inputFormatter = mockInputFormatter.Object;
164
var mockInputFormatter = new Mock<
IInputFormatter
>();
170
var
inputFormatter = mockInputFormatter.Object;
195
var mockInputFormatter = new Mock<
IInputFormatter
>();
198
var
inputFormatter = mockInputFormatter.Object;
223
var mockInputFormatter = new Mock<
IInputFormatter
>();
226
var
inputFormatter = mockInputFormatter.Object;
282
public static TheoryData<
IInputFormatter
> BuiltInFormattersThrowingInputFormatterException
286
return new TheoryData<
IInputFormatter
>()
297
IInputFormatter
formatter)
354
public static TheoryData<
IInputFormatter
> DerivedFormattersThrowingInputFormatterException
358
return new TheoryData<
IInputFormatter
>()
368
public async Task BindModel_DerivedXmlInputFormatters_AddsErrorToModelState(
IInputFormatter
formatter)
427
public static TheoryData<
IInputFormatter
, string> BuiltInFormattersThrowingNonInputFormatterException
431
return new TheoryData<
IInputFormatter
, string>()
443
IInputFormatter
formatter,
462
public static TheoryData<
IInputFormatter
, string> DerivedInputFormattersThrowingNonInputFormatterException
466
return new TheoryData<
IInputFormatter
, string>()
478
IInputFormatter
formatter,
546
var binder = CreateBinder(new List<
IInputFormatter
>());
568
var inputFormatters = new List<
IInputFormatter
>()
595
var inputFormatters = new List<
IInputFormatter
>()
624
var inputFormatters = new List<
IInputFormatter
>()
668
var binder = new BodyModelBinder(new List<
IInputFormatter
>(), new TestHttpRequestStreamReaderFactory());
707
private static BodyModelBinder CreateBinder(IList<
IInputFormatter
> formatters, bool treatEmptyInputAsDefaultValueOption = false)
716
private static BodyModelBinder CreateBinder(IList<
IInputFormatter
> formatters, MvcOptions mvcOptions)