angularjs - Can we write more than one get/post custom methods in webAPIController?? If so how to pass string parameter to that customized method? -


i new webapi , mvc....please me go forward. below scenario in facing issue.

in webapi controller want write custom/userdefined get/post method , want pass string parameter argument. throwing error.... defaultly accepting integer parameter.

below method need add webapicontroller.

[httpget] public bool isexists(string email) { //code: return true if email exists else returns false. } 

even added custom routing in webapi.config file before default api routing.

routes.maphttproute(      name: "customapi",      routetemplate: "api/{controller}/{action}/{email:string}",      defaults: null ); 

thanks in advance. :)

you use attribute routing if using webapi 2:

[route("api/emails/exists/{email}")] [httpget] public bool isexists(string email) { //code: return true if email exists else returns false. } 

this take value passed in {email} , pass in method.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -