I will focus on the new way here , in .net 4.5 we can use the ( async , await ) new keywords to tell the compiler , well we have an async method being called , this applies to actions so we can mark the action to be and async and instead of breaking the logic into two methods ( that looks ugly and breaks the logical sequence of the code ) to the normal action method but we need to tell the compiler this is an async controller

so the normal code looks like this

public ActionResult Index()

{

var faceBookCount = GetFacebookCommentCount(); // takes some time

var commentCount = GetFacebookLikeCountAsync(); // takes some time

var faceBookStatus = new FaceBookStatus()

{

FaceBookCount = faceBookCount,

CommentCount = commentCount

};

return View(faceBookStatus);

}

to be :

public async Task<ActionResult> Index()

{

var faceBookCount = await GetFacebookCommentCountAsync();

var commentCount = await GetFacebookLikeCountAsync();

var faceBookStatus = new FaceBookStatus()

{

FaceBookCount = faceBookCount,

CommentCount = commentCount

};

return View(faceBookStatus);

}

so this makes the application pool release the thread that is handling your request and then assign another one to handle the request after the function marked with await finished work so the web server does not get blocked