Class ServiceCollectionExtensions
- Assembly
- Cuemon.Extensions.AspNetCore.dll
Extension methods for the IServiceCollection interface.
public static class ServiceCollectionExtensions
- Inheritance
-
ServiceCollectionExtensions
Methods
AddExceptionDescriptorOptions(IServiceCollection, Action<ExceptionDescriptorOptions>)
Registers the specified setup
to configure ExceptionDescriptorOptions in the services
collection.
public static IServiceCollection AddExceptionDescriptorOptions(this IServiceCollection services, Action<ExceptionDescriptorOptions> setup = null)
Parameters
services
IServiceCollectionThe IServiceCollection to extend.
setup
Action<ExceptionDescriptorOptions>The ExceptionDescriptorOptions that may be configured.
Returns
- IServiceCollection
A reference to
services
so that additional configuration calls can be chained.
AddFaultDescriptorOptions(IServiceCollection, Action<FaultDescriptorOptions>)
Registers the specified setup
to configure FaultDescriptorOptions in the services
collection.
public static IServiceCollection AddFaultDescriptorOptions(this IServiceCollection services, Action<FaultDescriptorOptions> setup = null)
Parameters
services
IServiceCollectionThe IServiceCollection to extend.
setup
Action<FaultDescriptorOptions>The FaultDescriptorOptions that may be configured.
Returns
- IServiceCollection
A reference to
services
so that additional configuration calls can be chained.
Exceptions
- ArgumentException
setup
failed to configure an instance of FaultDescriptorOptions in a valid state.
AddServerTiming(IServiceCollection, Action<ServerTimingOptions>)
Adds a ServerTiming service to the specified IServiceCollection.
public static IServiceCollection AddServerTiming(this IServiceCollection services, Action<ServerTimingOptions> setup = null)
Parameters
services
IServiceCollectionThe IServiceCollection to add services to.
setup
Action<ServerTimingOptions>The ServerTimingOptions that may be configured.
Returns
- IServiceCollection
An IServiceCollection that can be used to further configure other services.
AddServerTiming<T>(IServiceCollection, Action<ServerTimingOptions>)
Adds an implementation of IServerTiming service to the specified IServiceCollection.
public static IServiceCollection AddServerTiming<T>(this IServiceCollection services, Action<ServerTimingOptions> setup = null)
where T : class, IServerTiming
Parameters
services
IServiceCollectionThe IServiceCollection to add services to.
setup
Action<ServerTimingOptions>The ServerTimingOptions that may be configured.
Returns
- IServiceCollection
An IServiceCollection that can be used to further configure other services.
Type Parameters
T
AddServerTimingOptions(IServiceCollection, Action<ServerTimingOptions>)
Registers the specified setup
to configure ServerTimingOptions in the services
collection.
public static IServiceCollection AddServerTimingOptions(this IServiceCollection services, Action<ServerTimingOptions> setup = null)
Parameters
services
IServiceCollectionThe IServiceCollection to extend.
setup
Action<ServerTimingOptions>The ServerTimingOptions that may be configured.
Returns
- IServiceCollection
A reference to
services
so that additional configuration calls can be chained.
Exceptions
- ArgumentException
setup
failed to configure an instance of ServerTimingOptions in a valid state.
PostConfigureAllExceptionDescriptorOptions(IServiceCollection, Action<IExceptionDescriptorOptions>)
Registers an action used to post-configure all instances of IExceptionDescriptorOptions in the services
collection.
These are run after Configure<TOptions>(IServiceCollection, Action<TOptions>).
public static IServiceCollection PostConfigureAllExceptionDescriptorOptions(this IServiceCollection services, Action<IExceptionDescriptorOptions> setup)
Parameters
services
IServiceCollectionThe IServiceCollection to extend.
setup
Action<IExceptionDescriptorOptions>The IExceptionDescriptorOptions which need to be configured.
Returns
- IServiceCollection
A reference to
services
so that additional configuration calls can be chained.