Tutorial by Examples

Simply add an attribute to the controller action [Route("product/{productId}/customer")] public IQueryable<Product> GetProductsByCustomer(int productId) { //action code goes here } this will be queried as /product/1/customer and productId=1 will be sent to the controll...
Usually, the routes in a controller have the same prefix connected somehow with functionality of this controller. For example: public class ProductsController : ApiController { [Route("api/products")] public IEnumerable<Product> GetProducts() { ... } [Route("a...

Page 1 of 1