AsyncLocal<T> 建構函式

定義

具現化 AsyncLocal<T> 執行個體。

多載

AsyncLocal<T>()

具現化不會接收變更告知的 AsyncLocal<T> 執行個體。

AsyncLocal<T>(Action<AsyncLocalValueChangedArgs<T>>)

具現化會接收變更告知的 AsyncLocal<T> 本機執行個體。

AsyncLocal<T>()

來源:
AsyncLocal.cs
來源:
AsyncLocal.cs
來源:
AsyncLocal.cs

具現化不會接收變更告知的 AsyncLocal<T> 執行個體。

C#
public AsyncLocal();

適用於

.NET 10 和其他版本
產品 版本
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.3, 1.4, 1.6, 2.0, 2.1
UWP 10.0

AsyncLocal<T>(Action<AsyncLocalValueChangedArgs<T>>)

來源:
AsyncLocal.cs
來源:
AsyncLocal.cs
來源:
AsyncLocal.cs

具現化會接收變更告知的 AsyncLocal<T> 本機執行個體。

C#
[System.Security.SecurityCritical]
public AsyncLocal(Action<System.Threading.AsyncLocalValueChangedArgs<T>> valueChangedHandler);
C#
public AsyncLocal(Action<System.Threading.AsyncLocalValueChangedArgs<T>>? valueChangedHandler);
C#
public AsyncLocal(Action<System.Threading.AsyncLocalValueChangedArgs<T>> valueChangedHandler);

參數

valueChangedHandler
Action<AsyncLocalValueChangedArgs<T>>

每當在任何執行緒上變更目前的值就會呼叫委派。

屬性

備註

委派的簽章為 Action<AsyncLocalValueChangedArgs<T>>

另請參閱

適用於

.NET 10 和其他版本
產品 版本
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.3, 1.4, 1.6, 2.0, 2.1
UWP 10.0