2 implementations of IHubContext
Microsoft.AspNetCore.SignalR.Core (1)
Internal\HubContext.cs (1)
6internal sealed class HubContext<THub> : IHubContext, IHubContext<THub> where THub : Hub
Microsoft.AspNetCore.SignalR.Tests (1)
AddSignalRTests.cs (1)
243public class CustomHubContext<THub> : IHubContext<THub> where THub : Hub
22 references to IHubContext
Microsoft.AspNetCore.SignalR.Core (3)
Internal\DefaultHubDispatcher.cs (2)
28private readonly IHubContext<THub> _hubContext; 42public DefaultHubDispatcher(IServiceScopeFactory serviceScopeFactory, IHubContext<THub> hubContext, bool enableDetailedErrors,
SignalRDependencyInjectionExtensions.cs (1)
27services.TryAddSingleton(typeof(IHubContext<>), typeof(HubContext<>));
Microsoft.AspNetCore.SignalR.Tests (15)
AddSignalRTests.cs (6)
33serviceCollection.AddSingleton(typeof(IHubContext<>), typeof(CustomHubContext<>)); 44Assert.IsType<CustomHubContext<CustomHub>>(serviceProvider.GetRequiredService<IHubContext<CustomHub>>()); 46Assert.IsType<CustomHubContext<CustomDynamicHub>>(serviceProvider.GetRequiredService<IHubContext<CustomDynamicHub>>()); 61serviceCollection.AddSingleton(typeof(IHubContext<>), typeof(CustomHubContext<>)); 69Assert.IsType<CustomHubContext<CustomHub>>(serviceProvider.GetRequiredService<IHubContext<CustomHub>>()); 71Assert.IsType<CustomHubContext<CustomDynamicHub>>(serviceProvider.GetRequiredService<IHubContext<CustomDynamicHub>>());
HubConnectionHandlerTests.ClientResult.cs (4)
145var context = serviceProvider.GetRequiredService<IHubContext<MethodHub>>(); 415var context = serviceProvider.GetRequiredService<IHubContext<MethodHub>>();
HubConnectionHandlerTests.cs (5)
221var context = serviceProvider.GetRequiredService<IHubContext<SimpleHub>>(); 4547IHubContext context = (IHubContext)serviceProvider.GetRequiredService<IHubContext<MethodHub>>(); 4637IHubContext<TestHub> context = serviceProvider.GetRequiredService<IHubContext<MethodHub>>();
SignalR.Client.FunctionalTestApp (4)
Startup.cs (1)
246endpoints.MapGet("/clientresult/{id}", async (IHubContext<TestHub> hubContext, string id) =>
TestHub.cs (3)
23private readonly IHubContext<TestHub> _context; 25public TestHub(IHubContext<TestHub> context) 77await ((IHubContext<TestHub>)state).Clients.Client(connectionId).SendAsync("StreamCanceled");