public void AddInterceptor(IHandlerInterceptor interceptor) { if (string.IsNullOrEmpty(interceptor.ControllerName)) { throw new Exception("It is no longer possible to use empty strings or nulls for ControllerName. If your intention is to indicate ALL, use the '*' character inside the string"); } if (string.IsNullOrEmpty(interceptor.ActionName)) { throw new Exception("It is no longer possible to use empty strings or nulls for ActionName. If your intention is to indicate ALL, use the '*' character inside the string"); } Interceptors.Add(interceptor); }
/// <summary> /// Adds a request interceptor for a specific server controller/action /// </summary> /// <param name="interceptor">Implementation of Interceptor</param> protected void AddInterceptor(IHandlerInterceptor interceptor) { IInterceptorManagerService manager = Services.GetService <IInterceptorManagerService>(); manager.AddInterceptor(interceptor); }
public void RegisterInterceptor(IHandlerInterceptor interceptor) { Interceptors.Add(interceptor); }