Example #1
0
 public ThrottlingHandler(IThrottleStore store, Func<string, long> maxRequestsForUserIdentifier, TimeSpan period, string message)
 {
     _store = store;
     _maxRequestsForUserIdentifier = maxRequestsForUserIdentifier;
     _period = period;
     _message = message;
 }
 public ThrottlingHandler(IThrottleStore store, Func <string, long> maxRequestsForUserIdentifier, TimeSpan period, string message)
 {
     _store = store;
     _maxRequestsForUserIdentifier = maxRequestsForUserIdentifier;
     _period  = period;
     _message = message;
 }
 /// <summary>
 /// 构造
 /// </summary>
 /// <param name="store"></param>
 /// <param name="maxRequestsForUserIdentifier"></param>
 /// <param name="period"></param>
 /// <param name="message"></param>
 public RequestFrequencyLimitHandlers(IThrottleStore store, Func <string, long> maxRequestsForUserIdentifier, TimeSpan period, string message = "对不起,您的请求频率过高({0}次/分钟),请稍后再试。")
 {
     _store = store;
     _maxRequestsForUserIdentifier = maxRequestsForUserIdentifier;
     _period  = period;
     _message = message;
 }
 public ThrottlingHandler(IThrottleStore store, Func <string, long> maxRequestsForUserIdentifier, TimeSpan period)
     : this(store, maxRequestsForUserIdentifier, period, "The allowed number of requests has been exceeded.")
 {
 }
Example #5
0
 public UserAwareThrottlingHandler(IThrottleStore store, Func <string, long> maxRequestsForUserIdentifier, TimeSpan period, string message) : base(store, maxRequestsForUserIdentifier, period, message)
 {
 }
 public ThrottlingHandlerWithFixedIdentifier(IThrottleStore store, Func <string, long> maxRequestsForUserIdentifier, TimeSpan period) : base(store, maxRequestsForUserIdentifier, period)
 {
 }
Example #7
0
 public ThrottlingHandler(IThrottleStore store, Func<string, long> maxRequestsForUserIdentifier, TimeSpan period)
     : this(store, maxRequestsForUserIdentifier, period, "The allowed number of requests has been exceeded.")
 {
 }
        public OwinCompatibleThrottlingHandler(IThrottleStore store, Func<string, long> maxRequestsForUserIdentifier, TimeSpan period, string message)
            : base(store, maxRequestsForUserIdentifier, period, message)
        {

        }
 public ThrottlingHandlerWithFixedIdentifier(IThrottleStore store, Func<string, long> maxRequestsForUserIdentifier, TimeSpan period) : base(store, maxRequestsForUserIdentifier, period)
 {
 }