共用方式為


AsyncStateExtensions.AddAsyncState(IServiceCollection) 方法

定義

新增、 IAsyncContext<T>Microsoft.Extensions.AsyncState.IAsyncLocalContext`1 服務的預設實作IAsyncState。 請注意,這些介面的實作不是安全線程。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddAsyncState(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddAsyncState (this Microsoft.Extensions.DependencyInjection.IServiceCollection services);
static member AddAsyncState : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddAsyncState (services As IServiceCollection) As IServiceCollection

參數

services
IServiceCollection

要加入實作的相依性插入容器。

傳回

services 的值。

例外狀況

servicesnull

適用於