title: ASP.NET Core: [FromQuery] usage and URL format
body: <p>I am trying to use [FromQuery] in my web api and I am not sure how to use it.</p>
  
  <p>Here's the GetAllBooks() method in the controller:</p>
  
  <pre><code> [HttpGet]
   [Route("api/v1/ShelfID/{shelfID}/BookCollection")]
   public async Task&lt;IActionResult&gt; GetAllBooks(string shelfID, [FromQuery] Book bookinfo)
              {
                 //do something
              }
  </code></pre>
  
  <p>Here's the Book model class:</p>
  
  <pre><code> public class Book
      {
          public string ID{ get; set; }
          public string Name{ get; set; }
          public string Author { get; set; }
          public string PublishDate { get; set; }
      }
  </code></pre>
  
  <p>I am confused about whether it is the correct way to use [FromQuery]. I thought the URL is </p>
  
  <blockquote>
    <p><code>https://localhost:xxxxx/api/v1/ShelfID/{shelfID}/BookCollection/IActionResult?ID="123"&amp;Name="HarryPotter"</code></p>
  </blockquote>
  
  <p>But the break point is not hitting my controller method, so I was thinking maybe the URL is not correct. Any suggestions? Thanks!</p>