ASP.Net MVC Controller Actions that return void

前端 未结 3 684
忘了有多久
忘了有多久 2020-12-03 06:26

If I have the following controller action...

public void DoSomething()
{
}

will the framework actually convert it to this?

         


        
3条回答
  •  爱一瞬间的悲伤
    2020-12-03 06:57

    Yes

    A controller that returns void will produce an EmptyResult.

    Taken from

    The Life And Times of an ASP.NET MVC Controller

提交回复
热议问题