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