共用方式為


RazorComponentsServiceCollectionExtensions.AddRazorComponents 方法

定義

註冊 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

服務集合。

傳回

IRazorComponentsBuilder,可用來進一步設定 Razor 元件服務。

適用於