Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

RazorComponentsServiceCollectionExtensions.AddRazorComponents Method

Definition

Namespace:
Microsoft.Extensions.DependencyInjection
Assembly:
Microsoft.AspNetCore.Components.Endpoints.dll
Package:
Microsoft.AspNetCore.App.Ref v10.0.0
Package:
Microsoft.AspNetCore.App.Ref v11.0.0-preview.4.26230.115
Package:
Microsoft.AspNetCore.App.Ref v8.0.19
Package:
Microsoft.AspNetCore.App.Ref v9.0.8
Source:
RazorComponentsServiceCollectionExtensions.cs

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Registers services required for server-side rendering of Razor Components.

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

Parameters

services
IServiceCollection

The service collection.

Returns

An IRazorComponentsBuilder that can be used to further configure the Razor component services.

Applies to


Feedback

Was this page helpful?