Skip to content

Commit 010c9f3

Browse files
committed
Add an extension method Users to IHubClients witch takes IEnumerable parameter
1 parent 178197e commit 010c9f3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/SignalR/server/Core/src/HubClientsExtensions.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,17 @@ public static T Users<T>(this IHubClients<T> hubClients, string user1)
493493
return hubClients.Users(new [] { user1 });
494494
}
495495

496+
/// <summary>
497+
/// Gets a <typeparamref name="T" /> that can be used to invoke methods on all connections associated with all of the specified users.
498+
/// </summary>
499+
/// <param name="hubClients">The abstraction that provides access to connections.</param>
500+
/// <param name="userIds">The user IDs.</param>
501+
/// <returns>A <typeparamref name="T" /> representing the methods that can be invoked on the clients.</returns>
502+
public static T Users<T>(this IHubClients<T> hubClients, IEnumerable<string> userIds)
503+
{
504+
return hubClients.Users(userIds.ToList());
505+
}
506+
496507
/// <summary>
497508
/// Gets a <typeparamref name="T" /> that can be used to invoke methods on all connections associated with all of the specified users.
498509
/// </summary>

0 commit comments

Comments
 (0)