Bagikan melalui


RazorComponentsServiceCollectionExtensions.AddRazorComponents Metode

Definisi

Mendaftarkan layanan yang diperlukan untuk rendering sisi server Komponen 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

Parameter

services
IServiceCollection

Koleksi layanan.

configure
Action<RazorComponentsServiceOptions>

Action<T> untuk mengonfigurasi yang disediakanRazorComponentsServiceOptions.

Mengembalikan

Yang IRazorComponentsBuilder dapat digunakan untuk mengonfigurasi lebih lanjut layanan komponen Razor.

Berlaku untuk