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
Post a Comment