2 writes to Context
Microsoft.AspNetCore.Components.Server.Tests (1)
Circuits\ComponentHubTest.cs (1)
140hub.Context = mockContext.Object;
Microsoft.AspNetCore.SignalR.Core (1)
Internal\DefaultHubDispatcher.cs (1)
661hub.Context = connection.HubCallerContext;
84 references to Context
Microsoft.AspNetCore.Components.Server (22)
ComponentHub.cs (22)
74var circuitHost = _circuitHandleRegistry.GetCircuit(Context.Items, CircuitKey); 80return _circuitRegistry.DisconnectAsync(circuitHost, Context.ConnectionId); 85var circuitHost = _circuitHandleRegistry.GetCircuit(Context.Items, CircuitKey); 92Context.Abort(); 108Context.Abort(); 116Context.Abort(); 122var circuitClient = new CircuitClientProxy(Clients.Caller, Context.ConnectionId); 126var resourceCollection = Context.GetHttpContext().GetEndpoint()?.Metadata.GetMetadata<ResourceAssetCollection>(); 132Context.User, 140_ = circuitHost.InitializeAsync(store, Context.ConnectionAborted); 145_circuitHandleRegistry.SetCircuit(Context.Items, CircuitKey, circuitHost); 150Log.CreatedCircuit(_logger, circuitHost.CircuitId, circuitHost.CircuitId.Secret, Context.ConnectionId); 159Context.Abort(); 179Context.Abort(); 188_ = circuitHost.UpdateRootComponents(operations, store, Context.ConnectionAborted); 205Context.ConnectionId, 206Context.ConnectionAborted); 209_circuitHandleRegistry.SetCircuit(Context.Items, CircuitKey, circuitHost); 210circuitHost.SetCircuitUser(Context.User); 346var handle = _circuitHandleRegistry.GetCircuitHandle(Context.Items, CircuitKey); 354Context.Abort(); 363Context.Abort();
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (16)
Hubs.cs (16)
33await Clients.Client(Context.ConnectionId).SendAsync("Echo", message); 38await Clients.Client(Context.ConnectionId).SendAsync("NoClientHandler"); 43return Context.ConnectionId; 54return Context.UserIdentifier; 59var context = Context.GetHttpContext(); 78return Context.GetHttpContext().Request.Cookies[cookieName]; 83var feature = Context.Features.Get<IHttpConnectionFeature>(); 98return Context.Features.Get<IHttpTransportFeature>().TransportType.ToString(); 103return Context.GetHttpContext()?.Request?.Protocol ?? "unknown"; 108Context.Abort(); 155await Clients.Client(Context.ConnectionId).Echo(message); 160await Clients.Client(Context.ConnectionId).NoClientHandler(); 165return Context.ConnectionId; 191await Clients.Client(Context.ConnectionId).Echo(message); 196await Clients.Client(Context.ConnectionId).NoClientHandler(); 201return Context.ConnectionId;
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (1)
EchoHub.cs (1)
28return Groups.AddToGroupAsync(Context.ConnectionId, groupName);
Microsoft.AspNetCore.SignalR.Tests (23)
HubConnectionHandlerTestUtils\Hubs.cs (23)
20return Groups.RemoveFromGroupAsync(Context.ConnectionId, groupName); 45return Groups.AddToGroupAsync(Context.ConnectionId, groupName); 125return Clients.Client(Context.ConnectionId).SendAsync("Send", new { }); 169return Context.GetHttpContext() != null; 309Context.Items[nameof(UploadDoesWorkOnComplete)] = tcs.Task; 333Context.ConnectionAborted.Register(state => ((TaskCompletionSource)state).SetResult(), tcs); 400var tcs = (TaskCompletionSource)Context.Items["ConnectedTask"]; 410var tcs = (TaskCompletionSource)Context.Items["ConnectedTask"]; 442return Groups.AddToGroupAsync(Context.ConnectionId, groupName); 490var tcs = (TaskCompletionSource)Context.Items["ConnectedTask"]; 528return Groups.AddToGroupAsync(Context.ConnectionId, groupName); 573await Clients.Client(Context.ConnectionId).GetClientResult(clientValue), 696Context.Abort(); 985await Clients.All.SendAsync("Send", $"{Context.ConnectionId} joined"); 1004await Clients.All.Send($"{Context.ConnectionId} joined"); 1240Context.Items[nameof(OnConnectedAsync)] = true; 1242Context.ConnectionAborted.Register(() => 1252Context.Items[nameof(OnDisconnectedAsync)] = true; 1269_state.TokenStateInConnected = Context.ConnectionAborted.IsCancellationRequested; 1271Context.ConnectionAborted.Register(() => 1291_state.TokenStateInDisconnected = Context.ConnectionAborted.IsCancellationRequested; 1337var tcs = (TaskCompletionSource)Context.Items["ConnectedTask"]; 1461string id = Context.GetHttpContext()?.Request.Query["client"] ?? string.Empty;
SignalR.Client.FunctionalTestApp (9)
TestHub.cs (9)
37return Context.ConnectionId; 42return int.Parse(Context.GetHttpContext().Request.Query["numRedirects"], CultureInfo.InvariantCulture); 52return Clients.Client(Context.ConnectionId).SendAsync("Message", message); 57return Clients.Client(Context.ConnectionId).SendAsync("CustomObject", customObject); 73var connectionId = Context.ConnectionId; 112return Context.Features.Get<IHttpTransportFeature>().TransportType.ToString(); 134return Context.GetHttpContext().Request.Headers["Content-Type"]; 139return Context.GetHttpContext().Request.Headers[headerName]; 144var cookies = Context.GetHttpContext().Request.Cookies;
SignalRSamples (13)
Hubs\Chat.cs (4)
12var name = Context.GetHttpContext().Request.Query["name"]; 18var name = Context.GetHttpContext().Request.Query["name"]; 49await Groups.AddToGroupAsync(Context.ConnectionId, groupName); 58await Groups.RemoveFromGroupAsync(Context.ConnectionId, groupName);
Hubs\DynamicChat.cs (4)
12var name = Context.GetHttpContext().Request.Query["name"]; 18var name = Context.GetHttpContext().Request.Query["name"]; 44await Groups.AddToGroupAsync(Context.ConnectionId, groupName); 53await Groups.RemoveFromGroupAsync(Context.ConnectionId, groupName);
Hubs\HubTChat.cs (4)
12var name = Context.GetHttpContext().Request.Query["name"]; 18var name = Context.GetHttpContext().Request.Query["name"]; 44await Groups.AddToGroupAsync(Context.ConnectionId, groupName); 53await Groups.RemoveFromGroupAsync(Context.ConnectionId, groupName);
Hubs\Streaming.cs (1)
27return observable.AsChannelReader(Context.ConnectionAborted);