diff --git a/aspnet/web-api/overview/web-api-routing-and-actions/create-a-rest-api-with-attribute-routing/samples/sample17.cs b/aspnet/web-api/overview/web-api-routing-and-actions/create-a-rest-api-with-attribute-routing/samples/sample17.cs index 93bcb936ca..b55eabf4ae 100644 --- a/aspnet/web-api/overview/web-api-routing-and-actions/create-a-rest-api-with-attribute-routing/samples/sample17.cs +++ b/aspnet/web-api/overview/web-api-routing-and-actions/create-a-rest-api-with-attribute-routing/samples/sample17.cs @@ -1,7 +1,7 @@ -[Route("~api/authors/{authorId}/books")] +[Route("~/api/authors/{authorId:int}/books")] public IQueryable GetBooksByAuthor(int authorId) { return db.Books.Include(b => b.Author) .Where(b => b.AuthorId == authorId) .Select(AsBookDto); -} \ No newline at end of file +}