Created
March 10, 2021 02:38
-
-
Save lucassarcanjo/728a1f12b27cd4aa5c7fb87b8d16a5e2 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
using System.Threading.Tasks; | |
using LiveChat.Models; | |
using Microsoft.AspNetCore.SignalR; | |
namespace LiveChat.Hubs | |
{ | |
public class ChatHub : Hub<IChatClient> | |
{ | |
public async Task SendMessage(ChatMessage message) => | |
await Clients.Others.BroadcastMessage(message); | |
public async Task SignIn(string username) => | |
await Clients.Others.NewUserNotification(username); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment