PROPERTY

HubCallerContext.ConnectionAborted

Cancellation token associated with the connection ending. Pass it to bounded work when appropriate; it is not a proof that a previously committed write was rolled back. Requires the ASP.NET Core shared framework or matching reference assemblies.

Formal Syntax & Structure

csharp syntaxcsharp
Context.ConnectionAborted

Working Example

Example Snippetcsharp
using System;using System.Linq;using System.Threading;using Microsoft.AspNetCore.Components;using Microsoft.AspNetCore.Components.Forms;using Microsoft.AspNetCore.SignalR;// Partial snippet inside a hub method.CancellationToken token=Context.ConnectionAborted;
C# & .NET Reference