REST Web API is the most common and vital part of data accessibility via any platform that does have access to the database directly. Web API development with Microsoft technologies are a piece of cake thanks to the default scaffolding. There is, however, one aspect in web API that sometimes becomes necessary to achieve. In Microsoft web API technologies the frame work understand all the basic GET, POST, PUT, DELETE methods implementation with the same name as method type with alteration of arguments. But, at times there comes a situation when we need a method of similar type with same arguments but different name for different purpose, such scenario can be easily achieved by using REST Web API routing.
Today, I shall demonstrate a simple GET type method with different name and same argument type by using REST Web API routing.

The following are some prerequisites before you proceed any further in this article.
Prerequisites
- ASP.NET MVC 5.
- C# programming.
- REST Web API.
The example code is being developed in Microsoft Visual Studio 2013 Ultimate.
Let's begin now,
- Create new Web API project and name it "WebApiRouting".
- Rename "ValueController.cs" file to "WebApiController.cs".
- Now, in "WebApiController.cs" file create a new method as shown in the snippet:
Route("api/WebApi/GetValById")]
- Now, execute the project and use following link in the browser to see your newly created REST Web API method in action as follows:
yourlink:port/api/WebApi/GetValById?StudentId=8

Conclusion
In this tutorial you will learn how to use REST Web API routing to create new method of same argument type with different name. You will also learn how to access Rest Web API routing method

Al Qudah MajdPosted Nov 19, 2020, 2:09 PM
Hi .. I need help.. When I open from view directly its work fine .. But if pass parameter to action result and open the same view the URL then add first my current controller name and be like thatassum my rout attribute is [Route("api/customers/GET_ALL")] then it will be https://localhost:44341/MyController/api/customers/GET_ALL ,, i search for this problem but i cannt find any solution.. please help .. regards
Uttam ChaturvediPosted Oct 16, 2018, 9:26 AM
Nice Article!!!
Munesh SharmaPosted May 23, 2016, 2:06 PM
nice one
Vivek KumarPosted Apr 28, 2016, 2:47 PM
Good one
Rahul Kumar SaxenaPosted Apr 27, 2016, 1:28 PM
Good Show
Sonu ChaudharyPosted Apr 27, 2016, 8:02 AM
good one
Asma KhalidPosted Apr 27, 2016, 12:01 AM
Thanks for the appreciation.
Amit KumarPosted Apr 26, 2016, 12:42 PM
Nice One
Debasis SahaPosted Apr 26, 2016, 10:19 AM
Nice One..
NitinPosted Apr 26, 2016, 5:18 AM
thanks for sharing