3 instantiations of InputFormatterResult
Microsoft.AspNetCore.Mvc.Abstractions (3)
Formatters\InputFormatterResult.cs (3)
11private static readonly InputFormatterResult _failure = new InputFormatterResult(hasError: true); 12private static readonly InputFormatterResult _noValue = new InputFormatterResult(hasError: false); 82return new InputFormatterResult(model);
162 references to InputFormatterResult
FormatterWebSite (2)
StringInputFormatter.cs (2)
20public override async Task<InputFormatterResult> ReadRequestBodyAsync(InputFormatterContext context, Encoding effectiveEncoding) 26return await InputFormatterResult.SuccessAsync(stringContent);
Microsoft.AspNetCore.Mvc.Abstractions (24)
Formatters\IInputFormatter.cs (1)
27Task<InputFormatterResult> ReadAsync(InputFormatterContext context);
Formatters\InputFormatterContext.cs (1)
86/// <see cref="InputFormatterResult.NoValueAsync()"/>. If <see langword="true"/>, the input
Formatters\InputFormatterResult.cs (22)
11private static readonly InputFormatterResult _failure = new InputFormatterResult(hasError: true); 12private static readonly InputFormatterResult _noValue = new InputFormatterResult(hasError: false); 13private static readonly Task<InputFormatterResult> _failureAsync = Task.FromResult(_failure); 14private static readonly Task<InputFormatterResult> _noValueAsync = Task.FromResult(_noValue); 46/// Returns an <see cref="InputFormatterResult"/> indicating the <see cref="IInputFormatter.ReadAsync"/> 50/// An <see cref="InputFormatterResult"/> indicating the <see cref="IInputFormatter.ReadAsync"/> 53public static InputFormatterResult Failure() 59/// Returns a <see cref="Task"/> that on completion provides an <see cref="InputFormatterResult"/> indicating 63/// A <see cref="Task"/> that on completion provides an <see cref="InputFormatterResult"/> indicating the 66public static Task<InputFormatterResult> FailureAsync() 72/// Returns an <see cref="InputFormatterResult"/> indicating the <see cref="IInputFormatter.ReadAsync"/> 77/// An <see cref="InputFormatterResult"/> indicating the <see cref="IInputFormatter.ReadAsync"/> 80public static InputFormatterResult Success(object? model) 86/// Returns a <see cref="Task"/> that on completion provides an <see cref="InputFormatterResult"/> indicating 91/// A <see cref="Task"/> that on completion provides an <see cref="InputFormatterResult"/> indicating the 94public static Task<InputFormatterResult> SuccessAsync(object? model) 100/// Returns an <see cref="InputFormatterResult"/> indicating the <see cref="IInputFormatter.ReadAsync"/> 104/// An <see cref="InputFormatterResult"/> indicating the <see cref="IInputFormatter.ReadAsync"/> 107public static InputFormatterResult NoValue() 113/// Returns a <see cref="Task"/> that on completion provides an <see cref="InputFormatterResult"/> indicating 117/// A <see cref="Task"/> that on completion provides an <see cref="InputFormatterResult"/> indicating the 120public static Task<InputFormatterResult> NoValueAsync()
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (1)
DefaultApiDescriptionProviderTest.cs (1)
2811public override Task<InputFormatterResult> ReadRequestBodyAsync(
Microsoft.AspNetCore.Mvc.Core (13)
Formatters\InputFormatter.cs (4)
92public virtual Task<InputFormatterResult> ReadAsync(InputFormatterContext context) 104return InputFormatterResult.SuccessAsync(GetDefaultValueForType(context.ModelType)); 107return InputFormatterResult.NoValueAsync(); 118public abstract Task<InputFormatterResult> ReadRequestBodyAsync(InputFormatterContext context);
Formatters\SystemTextJsonInputFormatter.cs (5)
53public sealed override async Task<InputFormatterResult> ReadRequestBodyAsync( 78return InputFormatterResult.Failure(); 88return InputFormatterResult.Failure(); 104return InputFormatterResult.NoValue(); 109return InputFormatterResult.Success(model);
Formatters\TextInputFormatter.cs (3)
35public override Task<InputFormatterResult> ReadRequestBodyAsync(InputFormatterContext context) 48return InputFormatterResult.FailureAsync(); 60public abstract Task<InputFormatterResult> ReadRequestBodyAsync(
ModelBinding\Binders\BodyModelBinder.cs (1)
155var result = await formatter.ReadAsync(formatterContext);
Microsoft.AspNetCore.Mvc.Core.Test (45)
Formatters\InputFormatterTest.cs (3)
424var result = await formatter.ReadAsync(context); 434public override Task<InputFormatterResult> ReadRequestBodyAsync(InputFormatterContext context) 449public override Task<InputFormatterResult> ReadRequestBodyAsync(InputFormatterContext context)
Formatters\JsonInputFormatterTestBase.cs (22)
76var result = await formatter.ReadAsync(formatterContext); 97var result = await formatter.ReadAsync(formatterContext); 118var result = await formatter.ReadAsync(formatterContext); 143var result = await formatter.ReadAsync(formatterContext); 170var result = await formatter.ReadAsync(formatterContext); 198var result = await formatter.ReadAsync(formatterContext); 224var result = await formatter.ReadAsync(formatterContext); 245var result = await formatter.ReadAsync(formatterContext); 267var result = await formatter.ReadAsync(formatterContext); 299var result = await formatter.ReadAsync(formatterContext); 322var result = await formatter.ReadAsync(formatterContext); 348var result = await formatter.ReadAsync(formatterContext); 375var result = await formatter.ReadAsync(formatterContext); 400var result = await formatter.ReadAsync(formatterContext); 429var result = await formatter.ReadAsync(formatterContext); 459var result = await formatter.ReadAsync(formatterContext); 482var result = await formatter.ReadAsync(formatterContext); 506var result = await formatter.ReadAsync(formatterContext); 530var result = await formatter.ReadAsync(formatterContext); 552var result = await formatter.ReadAsync(formatterContext); 574var result = await formatter.ReadAsync(formatterContext); 600var result = await formatter.ReadAsync(formatterContext);
Formatters\SystemTextJsonInputFormatterTest.cs (2)
150var result = await formatter.ReadAsync(formatterContext); 172var result = await formatter.ReadAsync(formatterContext);
Formatters\TextInputFormatterTest.cs (3)
30var result = await formatter.ReadAsync(context); 221public override Task<InputFormatterResult> ReadRequestBodyAsync(InputFormatterContext context, Encoding encoding) 223return InputFormatterResult.SuccessAsync(_object);
ModelBinding\Binders\BodyModelBinderProviderTest.cs (1)
156public Task<InputFormatterResult> ReadAsync(InputFormatterContext context)
ModelBinding\Binders\BodyModelBinderTests.cs (14)
29.Returns(InputFormatterResult.SuccessAsync(new Person())) 126.Returns(InputFormatterResult.NoValueAsync()); 168.Returns(InputFormatterResult.NoValueAsync()) 725private readonly Func<InputFormatterContext, Encoding, Task<InputFormatterResult>> _readRequestBodyAsync; 727public XyzFormatter(Func<InputFormatterContext, Encoding, Task<InputFormatterResult>> readRequestBodyAsync) 739public override Task<InputFormatterResult> ReadRequestBodyAsync( 761public Task<InputFormatterResult> ReadAsync(InputFormatterContext context) 763return InputFormatterResult.SuccessAsync(this); 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 (4)
XmlDataContractSerializerInputFormatter.cs (2)
99public override async Task<InputFormatterResult> ReadRequestBodyAsync(InputFormatterContext context, Encoding encoding) 157return InputFormatterResult.Success(deserializedObject);
XmlSerializerInputFormatter.cs (2)
81public override async Task<InputFormatterResult> ReadRequestBodyAsync( 141return InputFormatterResult.Success(deserializedObject);
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (26)
XmlDataContractSerializerInputFormatterTest.cs (14)
154var result = await formatter.ReadAsync(context); 185var result = await formatter.ReadAsync(context); 218var result = await formatter.ReadAsync(context); 253var result = await formatter.ReadAsync(context); 285var result = await formatter.ReadAsync(context); 312var result = await formatter.ReadAsync(context); 346var result = await formatter.ReadAsync(context); 378var result = await formatter.ReadAsync(context); 404var result = await formatter.ReadAsync(context); 466var result = await formatter.ReadAsync(context); 549var result = await formatter.ReadAsync(context); 587var result = await formatter.ReadAsync(context); 647var result = await formatter.ReadAsync(context); 706var result = await formatter.ReadAsync(context);
XmlSerializerInputFormatterTest.cs (12)
59var result = await formatter.ReadAsync(context); 96var result = await formatter.ReadAsync(context); 132var result = await formatter.ReadAsync(context); 168var result = await formatter.ReadAsync(context); 212var result = await formatter.ReadAsync(context); 348var result = await formatter.ReadAsync(context); 382var result = await formatter.ReadAsync(context); 411var result = await formatter.ReadAsync(context); 483var result = await formatter.ReadAsync(context); 569var result = await formatter.ReadAsync(context); 608var result = await formatter.ReadAsync(context); 640var result = await formatter.ReadAsync(context);
Microsoft.AspNetCore.Mvc.NewtonsoftJson (6)
NewtonsoftJsonInputFormatter.cs (4)
94public override async Task<InputFormatterResult> ReadRequestBodyAsync( 184return InputFormatterResult.NoValue(); 188return InputFormatterResult.Success(model); 205return InputFormatterResult.Failure();
NewtonsoftJsonPatchInputFormatter.cs (2)
61public override async Task<InputFormatterResult> ReadRequestBodyAsync( 68var result = await base.ReadRequestBodyAsync(context, encoding);
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (41)
NewtonsoftJsonInputFormatterTest.cs (14)
47var result = await formatter.ReadAsync(formatterContext); 83var result = await formatter.ReadAsync(formatterContext); 121var result = await formatter.ReadAsync(formatterContext); 166var result = await formatter.ReadAsync(formatterContext); 243var result = await formatter.ReadAsync(formatterContext); 268var result = await formatter.ReadAsync(formatterContext); 298var result = await formatter.ReadAsync(formatterContext); 331var result = await formatter.ReadAsync(formatterContext); 363var result = await formatter.ReadAsync(formatterContext); 394var result = await formatter.ReadAsync(formatterContext); 425var result = await formatter.ReadAsync(formatterContext); 463var result = await formatter.ReadAsync(formatterContext); 511var result = await formatter.ReadAsync(formatterContext); 554var result = await formatter.ReadAsync(formatterContext);
NewtonsoftJsonPatchInputFormatterTest.cs (5)
46var result = await formatter.ReadAsync(formatterContext); 85var result = await formatter.ReadAsync(formatterContext); 116var result = await formatter.ReadAsync(formatterContext); 140var result = await formatter.ReadAsync(formatterContext); 215var result = await formatter.ReadAsync(formatterContext);
src\Mvc\Mvc.Core\test\Formatters\JsonInputFormatterTestBase.cs (22)
76var result = await formatter.ReadAsync(formatterContext); 97var result = await formatter.ReadAsync(formatterContext); 118var result = await formatter.ReadAsync(formatterContext); 143var result = await formatter.ReadAsync(formatterContext); 170var result = await formatter.ReadAsync(formatterContext); 198var result = await formatter.ReadAsync(formatterContext); 224var result = await formatter.ReadAsync(formatterContext); 245var result = await formatter.ReadAsync(formatterContext); 267var result = await formatter.ReadAsync(formatterContext); 299var result = await formatter.ReadAsync(formatterContext); 322var result = await formatter.ReadAsync(formatterContext); 348var result = await formatter.ReadAsync(formatterContext); 375var result = await formatter.ReadAsync(formatterContext); 400var result = await formatter.ReadAsync(formatterContext); 429var result = await formatter.ReadAsync(formatterContext); 459var result = await formatter.ReadAsync(formatterContext); 482var result = await formatter.ReadAsync(formatterContext); 506var result = await formatter.ReadAsync(formatterContext); 530var result = await formatter.ReadAsync(formatterContext); 552var result = await formatter.ReadAsync(formatterContext); 574var result = await formatter.ReadAsync(formatterContext); 600var result = await formatter.ReadAsync(formatterContext);