MVC3 = >> return EmptyResult() When it’s a good idea to return this?

You would basically use it to signify that you are not doing anything with an action’s
result.

From MSDN:

Represents a result that does nothing, such as a controller action method that returns nothing.

I have personally used on actions defined in an AsyncController, so if you have for instance an async action like:

public void SendMailAsync() { }

Basically an action in an AsnycController, you’ll need a xxxCompleted action as well (by convention)

public virtual ActionResult SendMailCompleted
{
    // do whatever
    return new EmptyResult();
}

Since this is not an action meant to be called by a user but by a background task, I’m not going to do anything with the result anyway.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)