ChatHub.cs 372 B

1234567891011121314151617
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Threading.Tasks;
  5. using Microsoft.AspNetCore.SignalR;
  6. namespace SupplierWeb.Hubs
  7. {
  8. public class ChatHub : Hub
  9. {
  10. public async Task SendMessage(string user, string message)
  11. {
  12. await Clients.All.SendAsync("ReceiveMessage", user, message);
  13. }
  14. }
  15. }