Below screen shot shows the routing of api using ProductAPI and DefaultAPI. Both render same result its just the urls are different.
Lets do a PUT operation using ProductAPI routing table.
Coming back to product controller, lets define the HTTP Verb and ActionName as shown below
Now WebApi operations can be performed using the actionname instead of method names.
Configuring Attribute based routing. I added Route attribute to each method as shown below.
No comments:
Post a Comment
Note: only a member of this blog may post a comment.