Created
January 3, 2019 02:14
-
-
Save dcomartin/e73567dd005435d2a9743aa355d2f901 to your computer and use it in GitHub Desktop.
This file contains 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; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Authorization; | |
using Microsoft.AspNetCore.SignalR; | |
namespace Practical.AspNetCore.SignalR | |
{ | |
public class MessageHub : Hub | |
{ | |
public Task SendMessageToAll(string message) | |
{ | |
return Clients.All.SendAsync("ReceiveMessage", message); | |
} | |
public Task SendMessageToCaller(string message) | |
{ | |
return Clients.Caller.SendAsync("ReceiveMessage", message); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment