Created
July 29, 2024 20:16
-
-
Save reflash/fcd0f2eae424519fd7aebee312063959 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class MessageHub: Hub | |
| { | |
| public async Task JoinGroup(string groupId) | |
| { | |
| await Groups.AddToGroupAsync(Context.ConnectionId, groupId); | |
| } | |
| public async Task BroadcastMessage(string groupId, string method, string message) | |
| { | |
| await Clients.Group(groupId).SendAsync(method, message); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment