DD.WellWorkover.Cloud/AsbCloudWebApi/SignalR/TelemetryHub.cs

19 lines
593 B
C#
Raw Normal View History

2022-04-11 18:00:34 +05:00
using Microsoft.AspNetCore.Authorization;
2021-04-08 17:54:02 +05:00
using Microsoft.AspNetCore.SignalR;
using System.Threading.Tasks;
namespace AsbCloudWebApi.SignalR
2021-04-08 17:54:02 +05:00
{
// SignalR manual:
// https://docs.microsoft.com/ru-ru/aspnet/core/signalr/introduction?view=aspnetcore-5.0
2021-04-08 17:54:02 +05:00
[Authorize]
public class TelemetryHub : Hub
2021-04-08 17:54:02 +05:00
{
public Task AddToGroup(string groupName)
=> Groups.AddToGroupAsync(Context.ConnectionId, groupName.ToString());
public Task RemoveFromGroup(string groupName)
=> Groups.RemoveFromGroupAsync(Context.ConnectionId, groupName);
}
}