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

适用于