JoinableTaskContext.Capture Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Captures the caller's context and serializes it as a string that is suitable for application via a subsequent call to RunAsync(Func<Task>, String, JoinableTaskCreationOptions).
public string? Capture ();
member this.Capture : unit -> string
Public Function Capture () As String
Returns
A string that represent the current context, or null
if there is none.
Remarks
To optimize calling patterns, this method returns null
even when inside a JoinableTask context when this JoinableTaskContext was initialized without a SynchronizationContext, which means no main thread exists and thus there is no need to capture and reapply tokens.