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

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

c# - two queries in same method -