c# - WebAPI route configuration for multiple HttpPost's with different actions -



c# - WebAPI route configuration for multiple HttpPost's with different actions -

i not trying rest. want this:

public class myv2controller { [httppost] public task<usermodel> action1([frombody] firstmodel firstmodel) { } [httppost] public task<usermodel> action2([frombody] secondmodel secondmodel) { } }

the routes should line this:

http://localhost:1234/api/v2/my/action1/ http://localhost:1234/api/v2/my/action2/

i have tried many different route configurations (including various combinations of attribute routing), nil seems work. how might create work?

using route attribute [routeprefix("api/v2/my")] public class myv2controller { [httppost] [route("action1")] public task<usermodel> action1([frombody] firstmodel firstmodel) { } [httppost] [route("action2")] public task<usermodel> action2([frombody] secondmodel secondmodel) { } }

c# asp.net-web-api

Comments

Popular posts from this blog

php - How to pass multiple values from url -

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

database - php search bar when I press submit with nothing in the search bar it shows all the data -