mirror of
https://github.com/chsakell/aspnet-core-signalr-angular.git
synced 2025-12-22 17:27:48 +00:00
21 lines
707 B
C#
21 lines
707 B
C#
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.AspNetCore.SignalR;
|
|
using Microsoft.AspNetCore.SignalR.Infrastructure;
|
|
using Microsoft.AspNetCore.SignalR.Hubs;
|
|
|
|
namespace LiveGameFeed.Controllers
|
|
{
|
|
public abstract class ApiHubController<T> : Controller
|
|
where T : Hub
|
|
{
|
|
private readonly IHubContext _hub;
|
|
public IHubConnectionContext<dynamic> Clients { get; private set; }
|
|
public IGroupManager Groups { get; private set; }
|
|
protected ApiHubController(IConnectionManager signalRConnectionManager)
|
|
{
|
|
var _hub = signalRConnectionManager.GetHubContext<T>();
|
|
Clients = _hub.Clients;
|
|
Groups = _hub.Groups;
|
|
}
|
|
}
|
|
} |