How to create Ror style Restful routing in Asp.net MVC Web Api
- by Jas
How to configure routing in asp.net web api, to that I can code for the following actions in my ApiController inherited class?
|======================================================================================|
|Http Verb| Path | Action | Used for |
|======================================================================================|
| GET | /photos | index | display a list of all photos |
| GET | /photos/new | new | return an HTML form for creating a new photo |
| POST | /photos/ | create | create a new photo |
| GET | /photos/:id | show | display a specific photo |
| GET | /photos/:id/edit | edit | return an HTML form for editing a photo |
| PUT | /photos/:id | update | update a specific photo |
| DELETE | /photos/:id | destroy | delete a specific photo |