RazorComponentsServiceCollectionExtensions.AddRazorComponents 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
註冊 Razor 元件伺服器端轉譯所需的服務。
public static Microsoft.Extensions.DependencyInjection.IRazorComponentsBuilder AddRazorComponents (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<Microsoft.AspNetCore.Components.Endpoints.RazorComponentsServiceOptions>? configure = default);
static member AddRazorComponents : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<Microsoft.AspNetCore.Components.Endpoints.RazorComponentsServiceOptions> -> Microsoft.Extensions.DependencyInjection.IRazorComponentsBuilder
<Extension()>
Public Function AddRazorComponents (services As IServiceCollection, Optional configure As Action(Of RazorComponentsServiceOptions) = Nothing) As IRazorComponentsBuilder
參數
- services
- IServiceCollection
服務集合。
- configure
- Action<RazorComponentsServiceOptions>
用於設定所提供 RazorComponentsServiceOptions 的 Action<T>。
傳回
IRazorComponentsBuilder,可用來進一步設定 Razor 元件服務。