I have a list of userDetails connected to a hub
and I am storing those users to List<UserDetails>
.I want to add some of the users to a Group
and broadcast a message to that group.
But I am not able to figure out how can I create a group.This is what I a have done so far:
foreach(var user in userDetails)
{
Groups.Add(user.connectionId, "Connected");
}
Clients.Group("Connected").broadcastMessage(message);
when ever you add a user to a group, if that group doesn't exist already it will be created for you, you don't need to create it specifically.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With