This is how to use .NET API Attribute Routing.
We can write action method to accept just parameter with query string or object. 
This is another way of passing parameter. But I wouldn’t recommend to use this method when there are many parameters. 
Following is controller example to use action method.
public class DefaultController : Controller
    {
        [Route("")]
        [Route("Default")]
        [Route("Default/Index")]
        public ActionResult Index()
        {
            return new EmptyResult();
        }
        [Route("Default/GetRecordsById/{id}")]
        public ActionResult GetRecordsById(int id)
        {
            string str = string.Format
            ("The id passed as parameter is: {0}", id);
            return Ok(str);
        }
    }
You can specify route on the controller level as well. 
This will be applicable to all action methods of the controller. 
If you examine our DefaultController class, you’ll observe that the Default route is used multiple times when specifying the route template for the action methods. The following code snippet shows how you can specify different route attributes at the controller level to make more flexible use of attribute routing.
[Route("Default")]   
public class DefaultController : Controller
{
  [Route("")]
  [Route("Index")]
  public ActionResult Index()
  {
      return new EmptyResult();
   }
  [HttpGet]
  [Route("Default/GetRecordsById/{id}")]
  public ActionResult GetRecordsById(int id)
  {
      string str = string.Format("The id passed as parameter is: {0}", id);
      return Ok(str);
   }
}