This is working example of Microsoft article on RestFull API with attribute routing.
Visual studio 2017
In the Package Manager Console window, run the following
add-migration Initial
update-database
http://localhost:61559/api/books
http://localhost:61559/api/books/1
http://localhost:61559/api/books/1/details
http://localhost:61559/api/author/2/books
http://localhost:61559/api/books/fantasy
Full article
https://docs.microsoft.com/en-us/aspnet/web-api/overview/web-api-routing-and-actions/create-a-rest-api-with-attribute-routing