Adding this [APIController] to the Form Controller class fixed the issue. In the form I used the asp-route atrribute to the name of the route in the controller and it works. In the form you only need the attribute asp-route which needs the name you passed to the route when you were defining the controller class like below.
[Route("api/controller", Name="Form" )]
[APIController]
public class FormController : ControllerBase
{
public IActionResult Get([FromForm] string Name,[From Form] string Query) {
return Ok("Success") ;
}
}
Then in your HTML file where the form lives, just make sure the form
Uses the tag asp-route name we defined
<form method="post" asp-route="Form" >
<input name="Name" type="text" />
<textarea name="Query"></textarea>
<input type="submit">
</form>