/// <summary>
 /// For testing purposes
 /// </summary>
 internal static void Reset()
 {
     _filterManager        = null;
     _store                = null;
     _sender               = null;
     _manager              = null;
     _registrationsManager = null;
     _user = null;
 }
Example #2
0
 /// <inheritdoc />
 public WebHookRegistrationsController(IWebHookRegistrationsManager registrationsManager,
                                       IWebHookIdValidator idValidator,
                                       IEnumerable <IWebHookRegistrar> webHookRegistrars,
                                       ILogger <WebHookRegistrationsController> logger)
 {
     _registrationsManager = registrationsManager;
     _idValidator          = idValidator;
     _webHookRegistrars    = webHookRegistrars;
     _logger = logger;
 }
Example #3
0
        public static IWebHookRegistrationsManager GetRegistrationsManager(this IDependencyScope services)
        {
            IWebHookRegistrationsManager registrationsManager = services.GetService <IWebHookRegistrationsManager>();

            if (registrationsManager == null)
            {
                IWebHookManager       manager       = services.GetManager();
                IWebHookStore         store         = services.GetStore();
                IWebHookFilterManager filterManager = services.GetFilterManager();
                IWebHookUser          userManager   = services.GetUser();
                registrationsManager = CustomServices.GetRegistrationsManager(manager, store, filterManager, userManager);
            }
            return(registrationsManager);
        }
Example #4
0
 /// <inheritdoc />
 protected override void Initialize(HttpControllerContext controllerContext)
 {
     base.Initialize(controllerContext);
     _registrationsManager = Configuration.DependencyResolver.GetRegistrationsManager();
     //  _registrationsManager = Configuration.DependencyResolver.GetBaladorRegistrationsManager();
 }
 /// <summary>
 /// Sets a default <see cref="IWebHookRegistrationsManager"/> implementation which is used if none are registered with the
 /// Dependency Injection engine.
 /// </summary>
 /// <param name="instance">The <see cref="IWebHookRegistrationsManager"/> to use. If <c>null</c> then a default implementation is used.</param>
 public static void SetRegistrationsManager(IWebHookRegistrationsManager instance)
 {
     _registrationsManager = instance;
 }
 /// <summary>
 /// Create new WebHookRegistrationsController
 /// </summary>
 public WebHookRegistrationsController(ILogger <WebHookRegistrationsController> logger, IWebHookRegistrationsManager registrationsManager)
 {
     _logger = logger;
     _registrationsManager = registrationsManager;
 }