diff --git a/aspnetcore/signalr/hubs.md b/aspnetcore/signalr/hubs.md index 6242e6285151..3c3a6ea6c0c6 100644 --- a/aspnetcore/signalr/hubs.md +++ b/aspnetcore/signalr/hubs.md @@ -576,13 +576,12 @@ The class includes a | Calls a method on all connections in the specified group, except the specified connections | | | Calls a method on multiple groups of connections | | | Calls a method on a group of connections, excluding the client that invoked the hub method | -| `Single` | Calls a method on a specific connected client | | | Calls a method on all connections associated with a specific user | | | Calls a method on all connections associated with the specified users | Each property or method in the preceding tables returns an object with a `SendAsync` method. The `SendAsync` method receives the name of the client method to call and any parameters. -The object returned by the `Single` method also contains an `InvokeAsync` method, which can be used to wait for a [result from the client](xref:signalr/hubs#client-results). +The object returned by the `Client` and `Caller` methods also contain an `InvokeAsync` method, which can be used to wait for a [result from the client](xref:signalr/hubs#client-results). ## Send messages to clients @@ -615,14 +614,14 @@ Using `Hub` enables compile-time checking of the client methods. Th In addition to making calls to clients, the server can request a result from a client. This requires the server to use `ISingleClientProxy.InvokeAsync` and the client to return a result from its `.On` handler. -There are two ways to use the API on the server, the first is to call `Single(...)` on the `Clients` property in a Hub method: +There are two ways to use the API on the server, the first is to call `Client(...)` or `Caller` on the `Clients` property in a Hub method: ```csharp public class ChatHub : Hub { public async Task WaitForMessage(string connectionId) { - var message = await Clients.Single(connectionId).InvokeAsync( + var message = await Clients.Client(connectionId).InvokeAsync( "GetMessage"); return message; } @@ -634,12 +633,12 @@ public class ChatHub : Hub > > This will be addressed in a future release. For more information, see [Support returning values from client invocations](https://github.com/dotnet/aspnetcore/issues/5280). -The second way is to call `Single(...)` on an instance of [`IHubContext`](xref:signalr/hubcontext): +The second way is to call `Client(...)` on an instance of [`IHubContext`](xref:signalr/hubcontext): ```csharp async Task SomeMethod(IHubContext context) { - string result = await context.Clients.Single(connectionID).InvokeAsync( + string result = await context.Clients.Client(connectionID).InvokeAsync( "GetMessage"); } ``` @@ -656,7 +655,7 @@ public class ChatHub : Hub { public async Task WaitForMessage(string connectionId) { - string message = await Clients.Single(connectionId).GetMessage(); + string message = await Clients.Client(connectionId).GetMessage(); return message; } }