30 instantiations of InputFormatterContext
Microsoft.AspNetCore.Mvc.Core (1)
ModelBinding\Binders\BodyModelBinder.cs (1)
108
var formatterContext = new
InputFormatterContext
(
Microsoft.AspNetCore.Mvc.Core.Test (19)
Formatters\InputFormatterTest.cs (11)
39
var context = new
InputFormatterContext
(
73
var context = new
InputFormatterContext
(
104
var context = new
InputFormatterContext
(
138
var context = new
InputFormatterContext
(
169
var context = new
InputFormatterContext
(
206
var context = new
InputFormatterContext
(
236
var context = new
InputFormatterContext
(
274
var context = new
InputFormatterContext
(
303
var context = new
InputFormatterContext
(
385
var context = new
InputFormatterContext
(
414
var context = new
InputFormatterContext
(
Formatters\JsonInputFormatterTestBase.cs (1)
657
return new
InputFormatterContext
(
Formatters\TextInputFormatterTest.cs (7)
19
var context = new
InputFormatterContext
(
47
var context = new
InputFormatterContext
(
69
var context = new
InputFormatterContext
(
93
var context = new
InputFormatterContext
(
119
var context = new
InputFormatterContext
(
153
var context = new
InputFormatterContext
(
187
var context = new
InputFormatterContext
(
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (8)
XmlDataContractSerializerInputFormatterTest.cs (4)
77
var formatterContext = new
InputFormatterContext
(
515
var context = new
InputFormatterContext
(
579
var context = new
InputFormatterContext
(
726
return new
InputFormatterContext
(
XmlSerializerInputFormatterTest.cs (4)
256
var formatterContext = new
InputFormatterContext
(
536
var context = new
InputFormatterContext
(
600
var context = new
InputFormatterContext
(
662
return new
InputFormatterContext
(
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (2)
NewtonsoftJsonPatchInputFormatterTest.cs (1)
246
return new
InputFormatterContext
(
src\Mvc\Mvc.Core\test\Formatters\JsonInputFormatterTestBase.cs (1)
657
return new
InputFormatterContext
(
197 references to InputFormatterContext
FormatterWebSite (1)
StringInputFormatter.cs (1)
20
public override async Task<InputFormatterResult> ReadRequestBodyAsync(
InputFormatterContext
context, Encoding effectiveEncoding)
Microsoft.AspNetCore.Mvc.Abstractions (8)
Formatters\IInputFormatter.cs (6)
13
/// <paramref name="context"/>'s <see cref="
InputFormatterContext
.ModelType"/>.
15
/// <param name="context">The <see cref="
InputFormatterContext
"/>.</param>
18
/// <paramref name="context"/>'s <see cref="
InputFormatterContext
.ModelType"/>. <c>false</c> otherwise.
20
bool CanRead(
InputFormatterContext
context);
25
/// <param name="context">The <see cref="
InputFormatterContext
"/>.</param>
27
Task<InputFormatterResult> ReadAsync(
InputFormatterContext
context);
Formatters\InputFormatterContext.cs (2)
16
/// Creates a new instance of <see cref="
InputFormatterContext
"/>.
42
/// Creates a new instance of <see cref="
InputFormatterContext
"/>.
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (1)
DefaultApiDescriptionProviderTest.cs (1)
2812
InputFormatterContext
context,
Microsoft.AspNetCore.Mvc.Core (14)
Formatters\InputFormatter.cs (4)
39
public virtual bool CanRead(
InputFormatterContext
context)
92
public virtual Task<InputFormatterResult> ReadAsync(
InputFormatterContext
context)
116
/// <param name="context">The <see cref="
InputFormatterContext
"/>.</param>
118
public abstract Task<InputFormatterResult> ReadRequestBodyAsync(
InputFormatterContext
context);
Formatters\SystemTextJsonInputFormatter.cs (1)
54
InputFormatterContext
context,
Formatters\TextInputFormatter.cs (5)
35
public override Task<InputFormatterResult> ReadRequestBodyAsync(
InputFormatterContext
context)
57
/// <param name="context">The <see cref="
InputFormatterContext
"/>.</param>
61
InputFormatterContext
context,
68
/// <param name="context">The <see cref="
InputFormatterContext
"/>.</param>
73
protected Encoding? SelectCharacterEncoding(
InputFormatterContext
context)
ModelBinding\Binders\BodyModelBinder.cs (4)
108
var
formatterContext = new InputFormatterContext(
202
public static void InputFormatterSelected(ILogger logger, IInputFormatter inputFormatter,
InputFormatterContext
formatterContext)
214
public static void InputFormatterRejected(ILogger logger, IInputFormatter inputFormatter,
InputFormatterContext
formatterContext)
226
public static void NoInputFormatterSelected(ILogger logger,
InputFormatterContext
formatterContext)
Microsoft.AspNetCore.Mvc.Core.Test (75)
Formatters\InputFormatterTest.cs (13)
39
var
context = new InputFormatterContext(
73
var
context = new InputFormatterContext(
104
var
context = new InputFormatterContext(
138
var
context = new InputFormatterContext(
169
var
context = new InputFormatterContext(
206
var
context = new InputFormatterContext(
236
var
context = new InputFormatterContext(
274
var
context = new InputFormatterContext(
303
var
context = new InputFormatterContext(
385
var
context = new InputFormatterContext(
414
var
context = new InputFormatterContext(
434
public override Task<InputFormatterResult> ReadRequestBodyAsync(
InputFormatterContext
context)
449
public override Task<InputFormatterResult> ReadRequestBodyAsync(
InputFormatterContext
context)
Formatters\JsonInputFormatterTestBase.cs (24)
41
var
formatterContext = CreateInputFormatterContext(typeof(string), httpContext);
73
var
formatterContext = CreateInputFormatterContext(typeof(int), httpContext);
94
var
formatterContext = CreateInputFormatterContext(typeof(string), httpContext);
115
var
formatterContext = CreateInputFormatterContext(typeof(string), httpContext);
139
var
formatterContext = CreateInputFormatterContext(
167
var
formatterContext = CreateInputFormatterContext(typeof(IEnumerable<IDictionary<string, short>>), httpContext);
194
var
formatterContext = CreateInputFormatterContext(
221
var
formatterContext = CreateInputFormatterContext(typeof(DateTime), httpContext);
242
var
formatterContext = CreateInputFormatterContext(typeof(ComplexModel), httpContext);
264
var
formatterContext = CreateInputFormatterContext(typeof(int[]), httpContext);
296
var
formatterContext = CreateInputFormatterContext(requestedType, httpContext);
317
var
formatterContext = CreateInputFormatterContext(typeof(List<ComplexModel>), httpContext);
344
var
formatterContext = CreateInputFormatterContext(typeof(ComplexModel), httpContext);
370
var
formatterContext = CreateInputFormatterContext(typeof(short[]), httpContext);
396
var
formatterContext = CreateInputFormatterContext(typeof(ComplexModel[]), httpContext, modelName: "names");
423
var
formatterContext = CreateInputFormatterContext(typeof(ComplexModel), httpContext);
453
var
formatterContext = CreateInputFormatterContext(
477
var
formatterContext = CreateInputFormatterContext(typeof(ComplexPoco), httpContext);
503
var
formatterContext = CreateInputFormatterContext(typeof(A), httpContext);
527
var
formatterContext = CreateInputFormatterContext(typeof(ComplexPoco), httpContext);
549
var
formatterContext = CreateInputFormatterContext(typeof(ComplexModel), httpContext);
571
var
formatterContext = CreateInputFormatterContext(typeof(ComplexModel), httpContext);
597
var
formatterContext = CreateInputFormatterContext(typeof(ComplexModel), httpContext);
648
protected static
InputFormatterContext
CreateInputFormatterContext(
Formatters\SystemTextJsonInputFormatterTest.cs (5)
74
var
formatterContext = CreateInputFormatterContext(typeof(List<int>), httpContext);
98
var
formatterContext = CreateInputFormatterContext(typeof(TypeWithBadConverters), httpContext);
119
var
formatterContext = CreateInputFormatterContext(typeof(TypeWithBadConverters), httpContext);
147
var
formatterContext = CreateInputFormatterContext(typeof(User), httpContext);
169
var
formatterContext = CreateInputFormatterContext(typeof(User), httpContext);
Formatters\TextInputFormatterTest.cs (9)
19
var
context = new InputFormatterContext(
47
var
context = new InputFormatterContext(
69
var
context = new InputFormatterContext(
93
var
context = new InputFormatterContext(
119
var
context = new InputFormatterContext(
153
var
context = new InputFormatterContext(
187
var
context = new InputFormatterContext(
221
public override Task<InputFormatterResult> ReadRequestBodyAsync(
InputFormatterContext
context, Encoding encoding)
226
public Encoding TestSelectCharacterEncoding(
InputFormatterContext
context)
ModelBinding\Binders\BodyModelBinderProviderTest.cs (2)
151
public bool CanRead(
InputFormatterContext
context)
156
public Task<InputFormatterResult> ReadAsync(
InputFormatterContext
context)
ModelBinding\Binders\BodyModelBinderTests.cs (22)
25
mockInputFormatter.Setup(f => f.CanRead(It.IsAny<
InputFormatterContext
>()))
28
mockInputFormatter.Setup(o => o.ReadAsync(It.IsAny<
InputFormatterContext
>()))
46
mockInputFormatter.Verify(v => v.CanRead(It.IsAny<
InputFormatterContext
>()), Times.Once);
47
mockInputFormatter.Verify(v => v.ReadAsync(It.IsAny<
InputFormatterContext
>()), Times.Once);
123
mockInputFormatter.Setup(f => f.CanRead(It.IsAny<
InputFormatterContext
>()))
125
mockInputFormatter.Setup(o => o.ReadAsync(It.IsAny<
InputFormatterContext
>()))
165
mockInputFormatter.Setup(f => f.CanRead(It.IsAny<
InputFormatterContext
>()))
167
mockInputFormatter.Setup(o => o.ReadAsync(It.IsAny<
InputFormatterContext
>()))
187
It.Is<
InputFormatterContext
>(ctx => ctx.TreatEmptyInputAsDefaultValue == treatEmptyInputAsDefaultValueOption)),
196
mockInputFormatter.Setup(f => f.CanRead(It.IsAny<
InputFormatterContext
>()))
224
mockInputFormatter.Setup(f => f.CanRead(It.IsAny<
InputFormatterContext
>()))
725
private readonly Func<
InputFormatterContext
, Encoding, Task<InputFormatterResult>> _readRequestBodyAsync;
727
public XyzFormatter(Func<
InputFormatterContext
, Encoding, Task<InputFormatterResult>> readRequestBodyAsync)
740
InputFormatterContext
context,
756
public bool CanRead(
InputFormatterContext
context)
761
public Task<InputFormatterResult> ReadAsync(
InputFormatterContext
context)
783
public override Task<InputFormatterResult> ReadRequestBodyAsync(
InputFormatterContext
context, Encoding encoding)
805
public override Task<InputFormatterResult> ReadRequestBodyAsync(
InputFormatterContext
context, Encoding encoding)
827
public override Task<InputFormatterResult> ReadRequestBodyAsync(
InputFormatterContext
context, Encoding encoding)
853
public override Task<InputFormatterResult> ReadRequestBodyAsync(
InputFormatterContext
context, Encoding encoding)
875
public override Task<InputFormatterResult> ReadRequestBodyAsync(
InputFormatterContext
context, Encoding encoding)
895
public override Task<InputFormatterResult> ReadRequestBodyAsync(
InputFormatterContext
context, Encoding encoding)
Microsoft.AspNetCore.Mvc.Formatters.Xml (2)
XmlDataContractSerializerInputFormatter.cs (1)
99
public override async Task<InputFormatterResult> ReadRequestBodyAsync(
InputFormatterContext
context, Encoding encoding)
XmlSerializerInputFormatter.cs (1)
82
InputFormatterContext
context,
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (45)
XmlDataContractSerializerInputFormatterTest.cs (24)
77
var
formatterContext = new InputFormatterContext(
99
var
context = GetInputFormatterContext(contentBytes, typeof(DummyClass));
151
var
context = GetInputFormatterContext(httpContext, typeof(TestLevelOne));
182
var
context = GetInputFormatterContext(httpContext, typeof(TestLevelOne));
215
var
context = GetInputFormatterContext(httpContext, typeof(TestLevelOne));
250
var
context = GetInputFormatterContext(httpContext, typeof(TestLevelOne));
282
var
context = GetInputFormatterContext(httpContext, typeof(TestLevelOne));
309
var
context = GetInputFormatterContext(contentBytes, typeof(TestLevelOne));
341
var
context = GetInputFormatterContext(httpContext, typeof(TestLevelOne));
375
var
context = GetInputFormatterContext(contentBytes, typeof(TestLevelTwo));
401
var
context = GetInputFormatterContext(contentBytes, typeof(DummyClass));
423
var
context = GetInputFormatterContext(contentBytes, typeof(TestLevelTwo));
439
var
context = GetInputFormatterContext(contentBytes, typeof(TestLevelTwo));
463
var
context = GetInputFormatterContext(contentBytes, typeof(DummyClass));
491
var
context = GetInputFormatterContext(contentBytes, typeof(TestLevelTwo));
515
var
context = new InputFormatterContext(
546
var
context = GetInputFormatterContext(contentBytes, typeof(TestLevelTwo));
579
var
context = new InputFormatterContext(
612
var
context = GetInputFormatterContext(contentBytes, typeof(DummyClass));
644
var
context = GetInputFormatterContext(contentBytes, typeof(DummyClass));
671
var
context = GetInputFormatterContext(contentBytes, typeof(DummyClass));
703
var
context = GetInputFormatterContext(contentBytes, typeof(DummyClass));
716
private
InputFormatterContext
GetInputFormatterContext(byte[] contentBytes, Type modelType)
722
private
InputFormatterContext
GetInputFormatterContext(HttpContext httpContext, Type modelType)
XmlSerializerInputFormatterTest.cs (21)
56
var
context = GetInputFormatterContext(httpContext, typeof(TestLevelOne));
93
var
context = GetInputFormatterContext(httpContext, typeof(TestLevelOne));
129
var
context = GetInputFormatterContext(httpContext, typeof(TestLevelOne));
165
var
context = GetInputFormatterContext(httpContext, typeof(TestLevelOne));
207
var
context = GetInputFormatterContext(httpContext, typeof(TestLevelOne));
256
var
formatterContext = new InputFormatterContext(
279
var
context = GetInputFormatterContext(contentBytes, modelType);
296
var
context = GetInputFormatterContext(contentBytes, typeof(DummyClass));
345
var
context = GetInputFormatterContext(contentBytes, typeof(TestLevelOne));
379
var
context = GetInputFormatterContext(contentBytes, typeof(TestLevelTwo));
408
var
context = GetInputFormatterContext(contentBytes, typeof(DummyClass));
435
var
context = GetInputFormatterContext(contentBytes, typeof(TestLevelTwo));
456
var
context = GetInputFormatterContext(contentBytes, typeof(TestLevelTwo));
480
var
context = GetInputFormatterContext(contentBytes, typeof(DummyClass));
511
var
context = GetInputFormatterContext(contentBytes, typeof(TestLevelTwo));
536
var
context = new InputFormatterContext(
566
var
context = GetInputFormatterContext(contentBytes, typeof(TestLevelTwo));
600
var
context = new InputFormatterContext(
637
var
context = GetInputFormatterContext(httpContext, typeof(TestLevelOne));
652
private
InputFormatterContext
GetInputFormatterContext(byte[] contentBytes, Type modelType)
658
private
InputFormatterContext
GetInputFormatterContext(HttpContext httpContext, Type modelType)
Microsoft.AspNetCore.Mvc.NewtonsoftJson (4)
NewtonsoftJsonInputFormatter.cs (2)
95
InputFormatterContext
context,
348
protected virtual JsonSerializer CreateJsonSerializer(
InputFormatterContext
context)
NewtonsoftJsonPatchInputFormatter.cs (2)
62
InputFormatterContext
context,
81
public override bool CanRead(
InputFormatterContext
context)
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (47)
NewtonsoftJsonInputFormatterTest.cs (15)
44
var
formatterContext = CreateInputFormatterContext(typeof(User), httpContext);
80
var
formatterContext = CreateInputFormatterContext(typeof(User), httpContext);
116
var
formatterContext = CreateInputFormatterContext(typeof(User), httpContext);
163
var
formatterContext = CreateInputFormatterContext(typeof(UserLogin), httpContext);
240
var
formatterContext = CreateInputFormatterContext(typeof(User), httpContext);
265
var
formatterContext = CreateInputFormatterContext(typeof(List<int>), httpContext);
295
var
formatterContext = CreateInputFormatterContext(typeof(User), httpContext);
328
var
formatterContext = CreateInputFormatterContext(typeof(User), httpContext);
360
var
formatterContext = CreateInputFormatterContext(typeof(TypeWithPrimitives), httpContext);
391
var
formatterContext = CreateInputFormatterContext(typeof(TypeWithPrimitives), httpContext);
422
var
formatterContext = CreateInputFormatterContext(typeof(TypeWithNestedComplex), httpContext);
460
var
formatterContext = CreateInputFormatterContext(typeof(string), httpContext.Object);
508
var
formatterContext = CreateInputFormatterContext(typeof(TypeWithPrimitives), httpContext);
551
var
formatterContext = CreateInputFormatterContext(typeof(Location), httpContext);
572
public new JsonSerializer CreateJsonSerializer(
InputFormatterContext
_) => base.CreateJsonSerializer(null);
NewtonsoftJsonPatchInputFormatterTest.cs (8)
43
var
formatterContext = CreateInputFormatterContext(typeof(JsonPatchDocument<Customer>), httpContext);
80
var
formatterContext = CreateInputFormatterContext(typeof(JsonPatchDocument<Customer>), httpContext);
113
var
formatterContext = CreateInputFormatterContext(typeof(JsonPatchDocument<Customer>), httpContext);
137
var
formatterContext = CreateInputFormatterContext(typeof(JsonPatchDocument<Customer>), httpContext);
166
var
formatterContext = CreateInputFormatterContext(typeof(JsonPatchDocument<Customer>), httpContext);
189
var
formatterContext = CreateInputFormatterContext(modelType, httpContext);
212
var
formatterContext = CreateInputFormatterContext(typeof(Customer), httpContext);
241
private
InputFormatterContext
CreateInputFormatterContext(Type modelType, HttpContext httpContext)
src\Mvc\Mvc.Core\test\Formatters\JsonInputFormatterTestBase.cs (24)
41
var
formatterContext = CreateInputFormatterContext(typeof(string), httpContext);
73
var
formatterContext = CreateInputFormatterContext(typeof(int), httpContext);
94
var
formatterContext = CreateInputFormatterContext(typeof(string), httpContext);
115
var
formatterContext = CreateInputFormatterContext(typeof(string), httpContext);
139
var
formatterContext = CreateInputFormatterContext(
167
var
formatterContext = CreateInputFormatterContext(typeof(IEnumerable<IDictionary<string, short>>), httpContext);
194
var
formatterContext = CreateInputFormatterContext(
221
var
formatterContext = CreateInputFormatterContext(typeof(DateTime), httpContext);
242
var
formatterContext = CreateInputFormatterContext(typeof(ComplexModel), httpContext);
264
var
formatterContext = CreateInputFormatterContext(typeof(int[]), httpContext);
296
var
formatterContext = CreateInputFormatterContext(requestedType, httpContext);
317
var
formatterContext = CreateInputFormatterContext(typeof(List<ComplexModel>), httpContext);
344
var
formatterContext = CreateInputFormatterContext(typeof(ComplexModel), httpContext);
370
var
formatterContext = CreateInputFormatterContext(typeof(short[]), httpContext);
396
var
formatterContext = CreateInputFormatterContext(typeof(ComplexModel[]), httpContext, modelName: "names");
423
var
formatterContext = CreateInputFormatterContext(typeof(ComplexModel), httpContext);
453
var
formatterContext = CreateInputFormatterContext(
477
var
formatterContext = CreateInputFormatterContext(typeof(ComplexPoco), httpContext);
503
var
formatterContext = CreateInputFormatterContext(typeof(A), httpContext);
527
var
formatterContext = CreateInputFormatterContext(typeof(ComplexPoco), httpContext);
549
var
formatterContext = CreateInputFormatterContext(typeof(ComplexModel), httpContext);
571
var
formatterContext = CreateInputFormatterContext(typeof(ComplexModel), httpContext);
597
var
formatterContext = CreateInputFormatterContext(typeof(ComplexModel), httpContext);
648
protected static
InputFormatterContext
CreateInputFormatterContext(