mardi 23 juillet 2019

.net core api project routing issue

I am new to .net core and not very good with the routing understanding. I am trying to make api calls using the route template as follows

routeTemplate: "api/{controller}/{action}/{id}"

When I created the .net core project of api type, it added a controller with the name of Values and the way its accessing the api calls is placing the routes on top of the controller.. [Route("api/[controller]")]

How can I set my controller to use the action step?

I basically want to be able to make calls to my api like this

https://localhost:44345/api/MyProcessor/getValues
https://localhost:44345/api/MyProcessor/AllDefinations

Where MyProcessor is the name of the controller.




Aucun commentaire:

Enregistrer un commentaire