jeudi 7 avril 2016

.net web api 2 issue with multiple posts

I am running into issues having multiple posts on one controller, I can multiple gets no problem. ActionName isnt working with multiple posts

its a routing issue and I cant figure out how to get around it.

my two posts are:

[HttpPost] [ActionName("InsertUserName")] public InsertUserNameResponse InsertUserName([FromBody] InsertUserNameRequest request)

[HttpPost] [ActionName("InsertSalesName")] public InsertSalesNameResponse InsertSalesName([FromBody] InsertSalesNameRequest request)

and my route are

config.Routes.MapHttpRoute( name: "InsertUserName", routeTemplate: "ManagementService/v1/InsertUserName", defaults: new { controller = "Management" } );

config.Routes.MapHttpRoute( name: "InsertSalesName", routeTemplate: "ManagementService/v1/InsertSalesName", defaults: new { controller = "Management" } );

the routes are different so Im not sure why they are conflicting. any suggestions to get this working would be very apreciated




Aucun commentaire:

Enregistrer un commentaire