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