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