Table of Contents

Class ServiceCollectionExtensions

Namespace
Cuemon.Extensions.AspNetCore.Http.Throttling
Assembly
Cuemon.Extensions.AspNetCore.dll

Extension methods for the Microsoft.Extensions.DependencyInjection.IServiceCollection interface.

public static class ServiceCollectionExtensions
Inheritance
Object
ServiceCollectionExtensions

Methods

AddMemoryThrottlingCache(IServiceCollection)

Adds a MemoryThrottlingCache service to the specified Microsoft.Extensions.DependencyInjection.IServiceCollection.

public static IServiceCollection AddMemoryThrottlingCache(this IServiceCollection services)

Parameters

services IServiceCollection

The Microsoft.Extensions.DependencyInjection.IServiceCollection to add services to.

Returns

IServiceCollection

An Microsoft.Extensions.DependencyInjection.IServiceCollection that can be used to further configure other services.

AddThrottlingCache<T>(IServiceCollection)

Adds a throttling cache service to the specified Microsoft.Extensions.DependencyInjection.IServiceCollection.

public static IServiceCollection AddThrottlingCache<T>(this IServiceCollection services)
    where T : class, IThrottlingCache

Parameters

services IServiceCollection

The Microsoft.Extensions.DependencyInjection.IServiceCollection to add services to.

Returns

IServiceCollection

An Microsoft.Extensions.DependencyInjection.IServiceCollection that can be used to further configure other services.

Type Parameters

T

AddThrottlingSentinelOptions(IServiceCollection, Action<ThrottlingSentinelOptions>)

Adds configuration of ThrottlingSentinelOptions for the application.

public static IServiceCollection AddThrottlingSentinelOptions(this IServiceCollection services, Action<ThrottlingSentinelOptions> setup = null)

Parameters

services IServiceCollection

The Microsoft.Extensions.DependencyInjection.IServiceCollection to extend.

setup Action<ThrottlingSentinelOptions>

The ThrottlingSentinelOptions which may be configured.

Returns

IServiceCollection

A reference to services so that additional configuration calls can be chained.

Exceptions

System.ArgumentNullException

services cannot be null.

System.ArgumentException

setup failed to configure an instance of ThrottlingSentinelOptions in a valid state.