forked from ddrilling/AsbCloudServer
Степанов Дмитрий Александрович
29a534258e
1. Сделал отправку уведомлений через SignalR. 2. Сделал рефакторинг для хабов.
19 lines
444 B
C#
19 lines
444 B
C#
using System.Threading.Tasks;
|
|
using Microsoft.AspNetCore.SignalR;
|
|
|
|
namespace AsbCloudWebApi.SignalR;
|
|
|
|
public abstract class BaseHub : Hub
|
|
{
|
|
public virtual Task AddToGroup(string groupName) =>
|
|
Groups.AddToGroupAsync(Context.ConnectionId, groupName);
|
|
|
|
public virtual Task RemoveFromGroup(string groupName) =>
|
|
Groups.RemoveFromGroupAsync(Context.ConnectionId, groupName);
|
|
}
|
|
|
|
public abstract class BaseHub<T> : BaseHub
|
|
where T : class
|
|
{
|
|
|
|
} |