RazorComponentsServiceCollectionExtensions.AddRazorComponents Method
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.
C#
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
The service collection.
- configure
- Action<RazorComponentsServiceOptions>
An Action<T> to configure the provided RazorComponentsServiceOptions.
An IRazorComponentsBuilder that can be used to further configure the Razor component services.
Product | Versions |
---|---|
ASP.NET Core | 8.0, 9.0 |