Skip to content

AsyncContextMixins.IsSameAsCurrentAsyncContext(AsyncContext) method

Defined in

Type: AsyncContextMixins Namespace: ReactiveUI.Extensions.Async Assembly: ReactiveUI.Extensions.dll

Applies to

net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net462, net481

public static bool IsSameAsCurrentAsyncContext(this AsyncContext @this)

View source

Summary: Determines whether the specified AsyncContext represents the current asynchronous context.

Parameters

NameTypeDescription
this[AsyncContext](#The [AsyncContext](# instance to compare with the current context.

Returns: bool -- true if the specified AsyncContext matches the current SynchronizationContext or TaskScheduler; otherwise, false.

Remarks

This method compares the SynchronizationContext or TaskScheduler of the provided AsyncContext with the current context to determine equivalence. Use this method to check if code is executing within the intended asynchronous environment.