title: REST API with multiple Get methods
body: <p>I am learning C# REST API implementation and i have a few questions about multiple Get methods.</p>
  
  <p>Below is my sample code from NET Core 2.1 project</p>
  
  <p>Questions:</p>
  
  <ol>
  <li><p>Can i implement multiple Get methods in same controller?</p></li>
  <li><p>Is my Configure code to MapRoute correct?</p></li>
  <li><p>What URL should be to call  GetByName 
     (<a href="https://localhost:44306/api/Books/author=Smith" rel="nofollow noreferrer">https://localhost:44306/api/Books/author=Smith</a>) method?</p></li>
  <li>is it normal to implement multiple GET,(POST) etc. methods in the same Controller</li>
  </ol>
  
  <p>BooksController-----</p>
  
  <pre><code>    [Route("")]
      [HttpGet]
      public ActionResult&lt;IEnumerable&lt;Book&gt;&gt; Get()
      {
          return _bookService.GetAll;
      }
  
  
      [Route("{name}")]
      [HttpGet]
      public ActionResult&lt;Book&gt; GetByName(string name)
      {
          var book = _bookService.GetByAuthor(name);
  
          if (book == null)
              return NotFound();
  
          return book;
      }
  </code></pre>
  
  <p>void Configure(IApplicationBuilder app, IHostingEnvironment env) ---</p>
  
  <pre><code>        app.UseMvc(routes =&gt; {
              routes.MapRoute(name: "author", template: 
             "api/{controller}/{GetByName}");
          });
  </code></pre>