Last active
October 20, 2020 13:07
-
-
Save berkslv/aa7a8a7e776902c33dd931194a9b645b to your computer and use it in GitHub Desktop.
ChatHub, only SendAll
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
using Microsoft.AspNetCore.SignalR; | |
using WebAPI.Helpers.Models; | |
public class ChatHub : Hub | |
{ | |
[HubMethodName("SendMessageToAll")] | |
public async Task SendMessage(ChatMessage message) | |
{ | |
await Clients.All.SendAsync("ReceiveMessage", message); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment