src/packages/EmbedIO/Security/IPBanningModuleExtensions.cs
/// <summary>
/// Sets a maximum amount of requests per second as a criterion for banning IP addresses.
/// </summary>
/// <typeparam name="TModule">The type of the module.</typeparam>
/// <param name="this">The module on which this method is called.</param>
/// <param name="maxRequests">The maximum requests per second.</param>
/// <returns>
///     <paramref name="this"/> with a maximum requests per second configured.
/// </returns>
Sets a maximum amount of requests per second as a criterion for banning IP addresses.
Sets a maximum amount of requests per second as a criterion for banning IP addresses .
public static TModule WithMaxRequestsPerSecond<TModule>(this TModule @this, int maxRequests = IPBanningRequestsCriterion.DefaultMaxRequestsPerSecond)
            where TModule : IPBanningModule
        {
            @this.RegisterCriterion(new IPBanningRequestsCriterion(maxRequests));
            return @this;
        }
public static TModule WithMaxRequestsPerSecond < TModule > ( this TModule @this , int maxRequests = IPBanningRequestsCriterion . DefaultMaxRequestsPerSecond ) where TModule : IPBanningModule { @this . RegisterCriterion ( new IPBanningRequestsCriterion ( maxRequests ) ) ; return @this ; }
Sets a maximum amount of requests per second as a criterion for banning IP addresses.
Sets a maximum amount of requests per second as a criterion for banning IP addresses .
with a maximum requests per second configured.
with a maximum requests per second configured .
TModule
this
maxRequests
int
The maximum requests per second.
The maximum requests per second .
this
The module on which this method is called.
The module on which this method is called .
typeparam
The type of the module.
The type of the module .