2023-10-30 12:13:38 +05:00
|
|
|
using System.Threading;
|
2023-07-10 16:59:11 +05:00
|
|
|
using System.Threading.Tasks;
|
|
|
|
using Microsoft.AspNetCore.SignalR;
|
|
|
|
|
|
|
|
namespace AsbCloudWebApi.SignalR;
|
|
|
|
|
2023-10-30 12:13:38 +05:00
|
|
|
public abstract class BaseHub<T> : Hub<T> where T : class
|
2023-07-10 16:59:11 +05:00
|
|
|
{
|
2024-07-04 11:02:45 +05:00
|
|
|
public virtual Task AddToGroup(string groupName) =>
|
|
|
|
Groups.AddToGroupAsync(Context.ConnectionId, groupName);
|
2023-07-10 16:59:11 +05:00
|
|
|
|
2024-07-04 11:02:45 +05:00
|
|
|
public virtual Task RemoveFromGroup(string groupName) =>
|
|
|
|
Groups.RemoveFromGroupAsync(Context.ConnectionId, groupName);
|
2023-07-10 16:59:11 +05:00
|
|
|
}
|