Conditionally disable ASP.NET MVC Controller

后端 未结 3 901
终归单人心
终归单人心 2020-12-11 15:22

What is the best way to disable ASP.NET MVC controller conditionally?

I want to have an access to the controller actions if some value in web.config is \"true\" and

3条回答
  •  时光取名叫无心
    2020-12-11 15:42

    Answered here - Prevent ASP.NET Core discovering Controller in separate assembly

    This approach doesn't need filters, and hides controller from swagger etc.

提交回复
热议问题