92 instantiations of FromBodyAttribute
ApiExplorerWebSite (2)
Controllers\ApiExplorerParametersController.cs (1)
25
public void SimpleModelFromBody(int id, [
FromBody
] Product product)
Controllers\ApiExplorerRouteAndPathParametersInformationController.cs (1)
33
public void MultipleTypesOfParameters(string query, string pathAndQuery, [
FromBody
] string pathAndFromBody) { }
BasicWebSite (13)
Controllers\ActionConstraints\ConsumesAttribute_MediaTypeSuffix.cs (2)
13
public Product CreateProduct([
FromBody
] Product_Json jsonInput)
22
public Product CreateProduct([
FromBody
] Product_Xml xmlInput)
Controllers\ActionConstraints\ConsumesAttribute_NoFallBackActionController.cs (2)
13
public Product CreateProduct([
FromBody
] Product_Json jsonInput)
19
public Product CreateProduct([
FromBody
] Product_Xml xmlInput)
Controllers\ActionConstraints\ConsumesAttribute_OveridesBaseController.cs (2)
13
public Product CreateProduct([
FromBody
] Product_Json product)
20
public virtual IActionResult CreateProduct([
FromBody
] Product product)
Controllers\ActionConstraints\ConsumesAttribute_OveridesController.cs (1)
12
public override IActionResult CreateProduct([
FromBody
] Product product)
Controllers\ContactApiController.cs (2)
34
public ActionResult<Contact> Post([
FromBody
] Contact contact)
42
public ActionResult<Contact> PostWithVnd([
FromBody
] Contact contact)
Controllers\FiltersController.cs (1)
15
public IActionResult AlwaysRunResultFiltersCanRunWhenResourceFilterShortCircuit([
FromBody
] Product product) =>
Controllers\RequestSizeLimitController.cs (1)
26
public ActionResult<Product> DisableRequestSizeLimit([
FromBody
] Product product)
Controllers\TestingController.cs (1)
26
[
FromBody
] Number number,
Models\Contact.cs (1)
39
[
FromBody
]
FormatterWebSite (26)
Controllers\DoNotRespectBrowserAcceptHeaderController.cs (1)
32
public IActionResult CreateEmployee([
FromBody
] Employee employee)
Controllers\HomeController.cs (7)
14
public IActionResult Index([
FromBody
] DummyClass dummyObject)
26
public bool CheckIfDummyIsNull([
FromBody
] DummyClass dummy)
42
public IActionResult DefaultBody([
FromBody
] DummyClass dummy)
46
public IActionResult OptionalBody([
FromBody
(EmptyBodyBehavior = EmptyBodyBehavior.Allow)] DummyClass dummy)
50
public IActionResult DefaultValueBody([
FromBody
] DummyClass dummy = null)
55
public IActionResult NonNullableBody([
FromBody
] DummyClass dummy)
59
public IActionResult NullableBody([
FromBody
] DummyClass? dummy)
Controllers\InputFormatterController.cs (1)
10
public IActionResult ReturnInput([
FromBody
] string test)
Controllers\JsonFormatterController.cs (6)
49
public IActionResult ReturnNonNullableInput([
FromBody
] DummyClass dummyObject)
61
public IActionResult ReturnInput([
FromBody
] DummyClass dummyObject)
72
public IActionResult ValueTypeAsBody([
FromBody
] int value)
83
public ActionResult<SimpleModel> RoundtripSimpleModel([
FromBody
] SimpleModel model)
89
public ActionResult<SimpleRecordModel> RoundtripRecordType([
FromBody
] SimpleRecordModel model) => model;
114
public ActionResult<SimpleModelWithValidation> RoundtripModelWithValidation([
FromBody
] SimpleModelWithValidation model)
Controllers\JsonPatchController.cs (1)
13
public IActionResult PatchProduct([
FromBody
] JsonPatchDocument<Product> patchDoc)
Controllers\PolymorphicBindingController.cs (1)
22
public IActionResult InputFormatted([
FromBody
] IModel person)
Controllers\PolymorphicPropertyBindingController.cs (1)
11
[
FromBody
]
Controllers\SerializableErrorController.cs (1)
11
public IActionResult CreateEmployee([
FromBody
] Employee employee)
Controllers\ValidationController.cs (7)
12
public IActionResult Index([
FromBody
] User user)
26
public string GetDeveloperName([
FromBody
] Developer developer)
60
public Project CreateProject([
FromBody
] Project project)
66
public SimpleTypePropertiesModel CreateSimpleTypePropertiesModel([
FromBody
] SimpleTypePropertiesModel simpleTypePropertiesModel)
72
public IActionResult ValidationProviderAttribute([
FromBody
] ValidationProviderAttributeModel validationProviderAttributeModel)
83
public IActionResult ValidationThrowsError_WhenValidationExceedsMaxValidationDepth([
FromBody
] InfinitelyRecursiveModel model)
90
public IActionResult CreateInvalidModel([
FromBody
] InvalidModel model)
GenericHostWebSite (1)
Controllers\TestingController.cs (1)
25
[
FromBody
] Number number,
HtmlGenerationWebSite (1)
Controllers\Catalog_CacheTagHelperController.cs (1)
79
[
FromBody
] List<Product> products)
Microsoft.AspNetCore.Http.Extensions.Tests (1)
RequestDelegateGenerator\SharedTypes.cs (1)
709
public record ParametersListWithExplicitFromBody(HttpContext HttpContext, [
FromBody
] Todo Todo);
Microsoft.AspNetCore.Http.Microbenchmarks (1)
src\Http\Http.Extensions\test\RequestDelegateGenerator\SharedTypes.cs (1)
709
public record ParametersListWithExplicitFromBody(HttpContext HttpContext, [
FromBody
] Todo Todo);
Microsoft.AspNetCore.Mvc.Abstractions.Test (4)
ModelBinding\BindingInfoTest.cs (4)
54
new
FromBodyAttribute
{ EmptyBodyBehavior = EmptyBodyBehavior.Allow },
129
new
FromBodyAttribute
() { EmptyBodyBehavior = EmptyBodyBehavior.Disallow }
255
new
FromBodyAttribute
(),
277
new
FromBodyAttribute
(),
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (6)
DefaultApiDescriptionProviderTest.cs (4)
2444
private void AcceptsProduct_Body([
FromBody
] Product product)
2570
private void FromBody([
FromBody
] int id)
2589
[
FromBody
]
2712
[
FromBody
]
EndpointMetadataApiDescriptionProviderTest.cs (2)
79
([
FromBody
] int fromBody) =>
605
AssertBodyParameter(GetApiDescription(([
FromBody
] int bar) => { }, httpMethods: ["POST"]), "bar", typeof(int));
Microsoft.AspNetCore.Mvc.Core.Test (8)
ApplicationModels\ControllerActionDescriptorProviderTests.cs (2)
1726
public void FromBodyParameter([
FromBody
] TestActionParameter entity) { }
1730
public void MultipleParameters(int id, [
FromBody
] TestActionParameter entity) { }
ApplicationModels\InferParameterBindingInfoConventionTest.cs (4)
947
public IActionResult ActionWithBoundParameter([
FromBody
] object parameter) => null;
1184
public IActionResult InferredAndSpecified(TestModel a, [
FromBody
] int b) => null;
1186
public IActionResult MultipleSpecified([
FromBody
] decimal a, [
FromBody
] int b) => null;
ApplicationModels\ParameterModelTest.cs (1)
16
new List<object>() { new
FromBodyAttribute
() });
ApplicationModels\PropertyModelTest.cs (1)
16
new List<object>() { new
FromBodyAttribute
() });
Microsoft.AspNetCore.Mvc.IntegrationTests (12)
BodyValidationIntegrationTests.cs (6)
344
[
FromBody
]
435
[
FromBody
]
488
[
FromBody
]
495
[
FromBody
]
685
[
FromBody
]
744
[
FromBody
]
ComplexRecordIntegrationTest.cs (2)
27
private record Person1(string Name, [
FromBody
] Address1 Address);
1899
private record Person9([
FromBody
] Address1 Address);
ComplexTypeIntegrationTestBase.cs (2)
59
[
FromBody
]
2044
[
FromBody
]
ValidationIntegrationTests.cs (1)
1700
[
FromBody
]
ValidationWithRecordIntegrationTests.cs (1)
1506
[
FromBody
]
Microsoft.AspNetCore.Mvc.RazorPages.Test (4)
Infrastructure\PageBinderFactoryTest.cs (4)
855
[
FromBody
]
872
[
FromBody
]
887
[
FromBody
]
895
[
FromBody
]
Microsoft.AspNetCore.OpenApi.Tests (6)
Services\OpenApiDocumentService\OpenApiDocumentServiceTests.RequestBody.cs (1)
320
builder.MapPost("/", ([
FromBody
] string name) => { });
Services\OpenApiGeneratorTests.cs (3)
95
[Consumes("application/custom")] ([
FromBody
] int fromBody) => { }));
434
AssertBodyParameter(GetOpenApiOperation(([
FromBody
] int bar) => { }), "bar", "integer");
892
var operation = GetOpenApiOperation(([
FromBody
] int fromBody, [FromRoute] int fromRoute, [FromServices] int fromServices) => { });
Services\OpenApiSchemaService\OpenApiSchemaService.RequestBodySchemas.cs (2)
183
builder.MapPost("/stream", ([
FromBody
] Stream stream) => { });
184
builder.MapPost("/pipereader", ([
FromBody
] PipeReader stream) => { });
Mvc.RoutingWebSite (1)
Controllers\ConsumesAttributeController.cs (1)
13
public IActionResult Json([
FromBody
] string json)
Sandbox (2)
Controllers\ValuesController.cs (2)
28
public void Post([
FromBody
]string value)
34
public void Put(int id, [
FromBody
]string value)
XmlFormattersWebSite (4)
Controllers\HomeController.cs (1)
13
public IActionResult Index([
FromBody
] DummyClass dummyObject)
Controllers\SerializableErrorController.cs (2)
32
public SerializableError LogErrors([
FromBody
] SerializableError serializableError)
38
public IActionResult CreateEmployee([
FromBody
] Employee employee)
Controllers\ValidationController.cs (1)
12
public IActionResult CreateStore([
FromBody
] Store store)
5 references to FromBodyAttribute
Microsoft.AspNetCore.Http.Extensions.Tests (2)
RequestDelegateGenerator\CompileTimeIncrementalityTests.cs (2)
67
var source = $"""app.MapGet("/", ([{typeof(
FromBodyAttribute
)}] {typeof(Todo)} todo) => TypedResults.Ok(todo));""";
70
app.MapGet("/", ([{typeof(
FromBodyAttribute
)}] {typeof(Todo)}? todo) => TypedResults.Ok(todo));
Microsoft.AspNetCore.Mvc.Core (3)
ApplicationModels\InferParameterBindingInfoConvention.cs (1)
100
nameof(
FromBodyAttribute
));
MvcOptions.cs (2)
65
/// action method parameter with <see cref="
FromBodyAttribute
"/>) should treat empty
70
/// using <see cref="
FromBodyAttribute
"/>) will register an error in the