Skip to content

Instantly share code, notes, and snippets.

@lucassarcanjo
Created March 10, 2021 02:38
Show Gist options
  • Save lucassarcanjo/728a1f12b27cd4aa5c7fb87b8d16a5e2 to your computer and use it in GitHub Desktop.
Save lucassarcanjo/728a1f12b27cd4aa5c7fb87b8d16a5e2 to your computer and use it in GitHub Desktop.
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