Class BlazorServiceCollectionExtensions
- Namespace
- NuvTools.AspNetCore.Blazor.Extensions
- Assembly
- NuvTools.AspNetCore.Blazor.dll
Extension methods for registering Blazor services in the dependency injection container.
public static class BlazorServiceCollectionExtensions
- Inheritance
-
BlazorServiceCollectionExtensions
- Inherited Members
Methods
AddBlazorServices(IServiceCollection)
Adds all Blazor services to the service collection as scoped services. This includes IClipboardService, ILocalStorageService, ISessionStorageService, ILoadingService, IDownloadFileService, and IConfirmExitService.
public static IServiceCollection AddBlazorServices(this IServiceCollection services)
Parameters
servicesIServiceCollectionThe service collection to add the services to.
Returns
- IServiceCollection
The service collection for chaining.
AddClipboardService(IServiceCollection)
Adds the IClipboardService to the service collection as a scoped service.
public static IServiceCollection AddClipboardService(this IServiceCollection services)
Parameters
servicesIServiceCollectionThe service collection to add the service to.
Returns
- IServiceCollection
The service collection for chaining.
AddConfirmExitService(IServiceCollection)
Adds the IConfirmExitService to the service collection as a scoped service.
public static IServiceCollection AddConfirmExitService(this IServiceCollection services)
Parameters
servicesIServiceCollectionThe service collection to add the service to.
Returns
- IServiceCollection
The service collection for chaining.
AddDownloadFileService(IServiceCollection)
Adds the IDownloadFileService to the service collection as a scoped service.
public static IServiceCollection AddDownloadFileService(this IServiceCollection services)
Parameters
servicesIServiceCollectionThe service collection to add the service to.
Returns
- IServiceCollection
The service collection for chaining.
AddLoadingService(IServiceCollection)
Adds the ILoadingService to the service collection as a scoped service.
public static IServiceCollection AddLoadingService(this IServiceCollection services)
Parameters
servicesIServiceCollectionThe service collection to add the service to.
Returns
- IServiceCollection
The service collection for chaining.
Remarks
The loading service is registered as scoped to maintain state per Blazor circuit/connection.
AddLocalStorageService(IServiceCollection)
Adds the ILocalStorageService to the service collection as a scoped service.
public static IServiceCollection AddLocalStorageService(this IServiceCollection services)
Parameters
servicesIServiceCollectionThe service collection to add the service to.
Returns
- IServiceCollection
The service collection for chaining.
AddSessionStorageService(IServiceCollection)
Adds the ISessionStorageService to the service collection as a scoped service.
public static IServiceCollection AddSessionStorageService(this IServiceCollection services)
Parameters
servicesIServiceCollectionThe service collection to add the service to.
Returns
- IServiceCollection
The service collection for chaining.