I am wanting to use the ISingleClientProxy.InvokeAsync send a message SignalR client and wait for a response. I can make this work until very easily using the following:
Server sends:
return await Clients.Client(connectionInfo.ConnectionId).InvokeAsync<string>("Test", default);
Client Returns:
this.hubConnection.On<string>("Test", () => { return "Successful"; });
My problem is I want to be able to send a parameter to the client and have it do something with it.
Something like this
Server sends:
return await Clients.Client(connectionInfo.ConnectionId).InvokeAsync<string>("Test", "Prefix", default);
Client Returns:
this.hubConnection.On<string>("Test", (prefix) => { return $"{prefix}Successful"; });
However I hit issues as soon as I send the parameters. In this example I get:
Anonymous function converted to a void returning delegate cannot return a value;
Can anyone assist?
Thanks in advance