Table of Contents

Class ServiceCollectionExtensions

Namespace
TwBlazor
Assembly
TwBlazor.dll

Extension methods for configuring TwBlazor services.

public static class ServiceCollectionExtensions
Inheritance
ServiceCollectionExtensions
Inherited Members

Methods

AddTwBlazor(IServiceCollection, Action<TwBlazorOptions>, Func<TwBlazorTheme>)

Adds TwBlazor services to the service collection with a theme factory, enabling hot reload support.

public static IServiceCollection AddTwBlazor(this IServiceCollection services, Action<TwBlazorOptions> configure, Func<TwBlazorTheme> themeFactory)

Parameters

services IServiceCollection

The service collection.

configure Action<TwBlazorOptions>

Action to configure TwBlazor options.

themeFactory Func<TwBlazorTheme>

A factory function that creates the theme. Called again on hot reload.

Returns

IServiceCollection

The service collection for method chaining.

AddTwBlazor(IServiceCollection, Action<TwBlazorOptions>, TwBlazorTheme)

Adds TwBlazor services to the service collection with custom configuration.

public static IServiceCollection AddTwBlazor(this IServiceCollection services, Action<TwBlazorOptions> configure, TwBlazorTheme theme)

Parameters

services IServiceCollection

The service collection.

configure Action<TwBlazorOptions>

Action to configure TwBlazor options.

theme TwBlazorTheme

The theme configuration.

Returns

IServiceCollection

The service collection for method chaining.

AddTwBlazor(IServiceCollection, TwBlazorTheme)

Adds TwBlazor services to the service collection with default configuration.

public static IServiceCollection AddTwBlazor(this IServiceCollection services, TwBlazorTheme theme)

Parameters

services IServiceCollection

The service collection.

theme TwBlazorTheme

The theme configuration.

Returns

IServiceCollection

The service collection for method chaining.