mirror of https://github.com/abpframework/abp.git
csharpabpc-sharpframeworkblazoraspnet-coredotnet-coreaspnetcorearchitecturesaasdomain-driven-designangularmulti-tenancy
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.2 KiB
38 lines
1.2 KiB
using System.Threading.Tasks;
|
|
|
|
namespace Volo.Abp.OperationRateLimiting;
|
|
|
|
public static class OperationRateLimitingCheckerExtensions
|
|
{
|
|
public static Task CheckAsync(
|
|
this IOperationRateLimitingChecker checker,
|
|
string policyName,
|
|
string parameter)
|
|
{
|
|
return checker.CheckAsync(policyName, new OperationRateLimitingContext { Parameter = parameter });
|
|
}
|
|
|
|
public static Task<bool> IsAllowedAsync(
|
|
this IOperationRateLimitingChecker checker,
|
|
string policyName,
|
|
string parameter)
|
|
{
|
|
return checker.IsAllowedAsync(policyName, new OperationRateLimitingContext { Parameter = parameter });
|
|
}
|
|
|
|
public static Task<OperationRateLimitingResult> GetStatusAsync(
|
|
this IOperationRateLimitingChecker checker,
|
|
string policyName,
|
|
string parameter)
|
|
{
|
|
return checker.GetStatusAsync(policyName, new OperationRateLimitingContext { Parameter = parameter });
|
|
}
|
|
|
|
public static Task ResetAsync(
|
|
this IOperationRateLimitingChecker checker,
|
|
string policyName,
|
|
string parameter)
|
|
{
|
|
return checker.ResetAsync(policyName, new OperationRateLimitingContext { Parameter = parameter });
|
|
}
|
|
}
|
|
|