Class ServiceCollectionExtensions
- Namespace
- Htmx.Components
- Assembly
- Htmx.Components.dll
Extension methods for registering Htmx Components services.
public static class ServiceCollectionExtensions
- Inheritance
-
ServiceCollectionExtensions
- Inherited Members
Methods
AddHtmxComponents(IServiceCollection, Action<HtmxComponentOptions>?)
Registers all required Htmx Components services and configuration.
public static IServiceCollection AddHtmxComponents(this IServiceCollection services, Action<HtmxComponentOptions>? configure = null)
Parameters
servicesIServiceCollectionThe service collection.
configureAction<HtmxComponentOptions>Optional configuration action for HtmxComponentOptions.
Returns
- IServiceCollection
The service collection.
AddHtmxComponentsApplicationPart(IMvcBuilder)
Adds the Htmx Components application part to MVC.
public static IMvcBuilder AddHtmxComponentsApplicationPart(this IMvcBuilder builder)
Parameters
builderIMvcBuilder
Returns
AddHtmxComponentsApplicationPart(IMvcCoreBuilder)
Adds the Htmx Components application part to MVC Core.
public static IMvcCoreBuilder AddHtmxComponentsApplicationPart(this IMvcCoreBuilder builder)
Parameters
builderIMvcCoreBuilder
Returns
AddSafeActionContextAccessor(IServiceCollection, string)
Registers the HTTP context accessor used to create action contexts from endpoint routing metadata.
[Obsolete("IActionContextAccessor is obsolete in ASP.NET Core 10. Use services.AddHttpContextAccessor() and IHttpContextAccessor with GetValidActionContext() instead.", DiagnosticId = "ASPDEPR006", UrlFormat = "https://aka.ms/aspnet/deprecate/006")]
public static IServiceCollection AddSafeActionContextAccessor(this IServiceCollection services, string extensionMethodName = "AddSafeActionContextAccessor")
Parameters
servicesIServiceCollectionextensionMethodNamestring