1. Route with passing id parameter
[] public class BooksController : ApiController
{
// GET /api/authors/1/books [] public IEnumerable<Book> GetByAuthor(int authorId) { ... }
// ... }
2. Route with passing id parameter int type
// GET /api/authors/1/books [] public IEnumerable<Book> GetByAuthor(int authorId) { ... }
3. Route With Passing parameter min 1 value or none of zero Constraint
[] public User GetUserById(int id) { ... }
[] public class BooksController : ApiController
{
// GET /api/authors/1/books [] public IEnumerable<Book> GetByAuthor(int authorId) { ... }
// ... }
2. Route with passing id parameter int type
// GET /api/authors/1/books [] public IEnumerable<Book> GetByAuthor(int authorId) { ... }
3. Route With Passing parameter min 1 value or none of zero Constraint
[] public User GetUserById(int id) { ... }
No comments:
Post a Comment