Quantcast
Channel: Using Optimizely Platforms
Viewing all articles
Browse latest Browse all 8020

Async Index method in block controller

$
0
0

Hi,

   I am trying to implement async call in block controller. 

The method inside Index method calls the Api endpoint. 

When making it async, is throws inner exception "InvalidOperationException: HttpServerUtility.Execute blocked while waiting for an asynchronous operation to complete."

It is causing a performance issue for the webiste, as we are having 4-5 blocks on page

[HttpGet]
        public async Task<ActionResult> Index(xBlock currentBlock, xyViewModel viewModel)
        {
            var xxx = await xxx.IndexAsync();
            var yyy= await yyy.Index2Async();
         return PartialView(viewModel);
}

How can I make block methods async ? I have tried a lot but still getting same error

ASP.Net version-> 5.2.7


Viewing all articles
Browse latest Browse all 8020

Trending Articles