Async and await in MVC 4 Controller

后端 未结 3 633
梦谈多话
梦谈多话 2020-12-18 19:57

Every time I try to use the new Async and Await operators and return a collection of objects from a database I get an Invalid Operation

3条回答
  •  鱼传尺愫
    2020-12-18 20:24

    It's been some time since this question was answered. But I was having a similar situation with MVC 5 and I was able to make a [ChildActionOnly] work asynchronously just by commenting out the following line under section of web.config file.

    
        
    

    EDIT: Consider this a workaround while you find a real solution for your situation. Please see Leri's comments below.

提交回复
热议问题