AsyncStateExtensions.AddAsyncState(IServiceCollection) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
新增、 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
的值。
例外狀況
services
為 null
。