WebSocketsDependencyInjectionExtensions.AddWebSockets 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
用於 IServiceCollection 新增 WebSocket 組態的擴充方法。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddWebSockets(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Action<Microsoft::AspNetCore::Builder::WebSocketOptions ^> ^ configure);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddWebSockets (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<Microsoft.AspNetCore.Builder.WebSocketOptions> configure);
static member AddWebSockets : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<Microsoft.AspNetCore.Builder.WebSocketOptions> -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddWebSockets (services As IServiceCollection, configure As Action(Of WebSocketOptions)) As IServiceCollection
參數
- services
- IServiceCollection
要新增 WebSocket 特定組態的服務集合。
- configure
- Action<WebSocketOptions>
設定 的組態回呼 WebSocketOptions 。