ASP .NET MVC NonAction meaning

后端 未结 10 1734
没有蜡笔的小新
没有蜡笔的小新 2021-01-03 17:39

Can anybody please tell me why should I use NonAction? I mean say I have a form with several submit values: Update, Delete or Insert. Since all the submit buttons have the s

10条回答
  •  忘掉有多难
    2021-01-03 18:09

    I just used [NonAction] in our web api, to decorate a bunch of Controller Methods (endpoints) because we had a last minute decision that we will postpone the delivery of the specific endpoints.

    So it is useful, if you want to avoid exposing an API endpoint, but still want to keep the implementation for later.

    So I used this attribute and it saved me a lot of time.

    I will just remove it in the next release and this will simply be there!

提交回复
热议问题