Hi,
how to execute MVC web api method with different name but type is GET and POST. i can't able to execute. it shows error. here is my code.
webapiconfig.cs
config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { action = "get", id = RouteParameter.Optional } ); Employee controller :
[HttpGet] public string Test1() { return "this is a test1 string"; } [HttpGet] public string Test2() { return "this is a test2 string"; } [HttpPost] public string Test3() { return "this is a test3 string"; } i want to execute both post and get all this method in different scenario. how to do it?
Saineshwar BageriPosted Nov 28, 2014, 11:41 PM
here is Sample Example of it please check this link
http://www.c-sharpcorner.com/UploadFile/4d9083/how-to-create-web-api-in-Asp-Net-mvc/