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

symfony - InvalidConfigurationException in SecurityExtension.php line 429: No authentication listener registered for firewall "secured_area" -

angular ui router - 10 digest iterations reached in angularjs when using $state.go -

javascript - Handling constructor related functions while testing with mocha and sinon -