How to handle hierarchical routes in ASP.NET Web API?

后端 未结 4 1044
日久生厌
日久生厌 2020-12-07 14:06

Currently I have two controllers

1 - Parent Controller

2 - Child Controller

I access my Parent Controller like this

someurl\\parentc         


        
4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-07 14:19

    An option beyond using default mvc routing is to look at Attribute Routing - https://github.com/mccalltd/AttributeRouting. Although its more work, decorating individual action methods provides a ton of flexibility when you need to design complicated routes. You can also use it in conjunction with standard MVC routing.

提交回复
热议问题