Make BlockController Index method async



I need the Index method of my blockcontroller to be async but since the base class already has a Index method that is sync this seems impossible. Anyone an idea how to fix this?

The end result I'm looking for will be something like this:

public class MyAsyncBlockController : BlockController
        public async Task Index(MyAsyncBlock currentBlock)
            // async code
Mar 13, 2016 19:18

Not 100% but I think you need to wait for future Epi versions to be able to do that.

Mar 13, 2016 23:29

Did you solve this?

I'm stuck with the same problem :s

Apr 05, 2016 10:16

Hi Jesper,

Nope, I guess we have to (a)wait ;)

Apr 07, 2016 8:57

I solved this issue by creating a new base controller to be used instead of BlockController:

public abstract class AsyncBlockController<TContentData> : ActionControllerBase, IRenderTemplate<TContentData>
    where TContentData : IContentData
    public abstract Task<ActionResult> Index(TContentData currentContent);

Sep 16, 2016 8:34
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.