c# - Error converting value "Any Value" to type 'System.Web.Http.IHttpActionResult' -


i'm getting error when call web api method returns bool (edit - object, error comes hub attribute):

error converting value true type 'system.web.http.ihttpactionresult

this method:

    [httpget]     [hub(name = "servicelog", incomingmethod = "logincoming", outgoingmethod = "logoutgoing")]     [responsetype(typeof(bool))]                 public async task<ihttpactionresult> testmethodasync(int i)     {         var result = await _repository.testmethodasync(i).configureawait(false);         return ok(result);     } 

edit: offending code in hub attribute:

public override async void onactionexecuted(httpactionexecutedcontext actionexecutedcontext)     {      ...             if (hub != null)         {             // line throws error             var response = await actionexecutedcontext.response.content.readasasync(actionexecutedcontext.actioncontext.actiondescriptor.returntype);             hub.clients.all.invoke(outgoingmethod, new { time = datetime.now.tostring("g"), data = response });          }     } 

from fiddler , browsers, 200 response , correct return value, visual studio throws error. causing error?


Comments

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -