forked from ddrilling/AsbCloudServer
20 lines
599 B
C#
20 lines
599 B
C#
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.SignalR;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace AsbCloudWebApi.SignalR
|
|
{
|
|
// SignalR manual:
|
|
// https://docs.microsoft.com/ru-ru/aspnet/core/signalr/introduction?view=aspnetcore-5.0
|
|
|
|
[Authorize]
|
|
public class ReportsHub : Hub<IReportHubClient>
|
|
{
|
|
public Task AddToGroup(string groupName)
|
|
=> Groups.AddToGroupAsync(Context.ConnectionId, groupName);
|
|
|
|
public Task RemoveFromGroup(string groupName)
|
|
=> Groups.RemoveFromGroupAsync(Context.ConnectionId, groupName);
|
|
}
|
|
}
|