cancel
Showing results for 
Search instead for 
Did you mean: 

How to define custom api routes in Azure Mobile Service when using .NET as Back end?

MichaelScruggs
Member

Tried both Table Controller and Custom Controller but not able to define two functions accepting the same parameters with same http method. For example when declaring

public Person GetMemberDetails(int id)
{
   // Some Code
   return person;
}

public Person GetMemberAddress(int id)
{
   // Some Code
   return person;
}

as both functions are requesting using GET and both have same input after building the project i am not able to use either of them. When i delete one or modifies one to use any other requesting method i am able to request from.

http://<azure-mobile-service-name>/Person/{id}

Is there any way to declare two functions with same signature and same method of request?

Dollar General Customer

4 REPLIES 4

Eva44
Member

Did you try setting MS_SkipVersionCheck to true in the app setting to opt out of version checking. You can specify this either in your web.config or in the Application Settings section of the Azure Portal.

My Insite Schedule

Lenard
Member

@MichaelScruggs wrote: mcdvoice survey

Tried both Table Controller and Custom Controller but not able to define two functions accepting the same parameters with same http method. For example when declaring

public Person GetMemberDetails(int id) { // Some Code return person; } public Person GetMemberAddress(int id) { // Some Code return person; }

as both functions are requesting using GET and both have same input after building the project i am not able to use either of them. When i delete one or modifies one to use any other requesting method i am able to request from.

http://<azure-mobile-service-name>/Person/{id} 

Is there any way to declare two functions with same signature and same method of request?

Dollar General Customer


As per RESTful principles you can have only one method for a verb with one particular signature. But you can always modify your routing and achieve it but you won't be sticking to REST though. In some cases if the situation demands it is alright to do so. refer this post Multiple HttpPost method in Web API controller

Lenard
Member

As per RESTful principles you can have only one method for a verb with one particular signature. But you can always modify your routing and achieve it but you won't be sticking to REST though. In some cases if the situation demands it is alright to do so. refer this post Multiple HttpPost method in Web API controller.

IndigoCard Login


@Lenard wrote: www.dmvnow.com


As per RESTful principles you can have only one method for a verb with one particular signature. But you can always modify your routing and achieve it but you won't be sticking to REST though. In some cases if the situation demands it is alright to do so. refer this post Multiple HttpPost method in Web API controller


Thank you for sharing the solution, my query has been solved.