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
。