public void FirePreActions(AbstractCommand command) { try { if (ShouldPingBefore) { IO.Http.Get(PingBeforeUrl); } } catch (Exception exception) { throw new LifecycleActionFailedException($"Ping to {PingBeforeUrl} failed before running command.", exception); } try { BeforeAction?.Invoke(command); } catch (Exception exception) { throw new LifecycleActionFailedException($"Failed to invoke action after command ran successfully.", exception); } }
/// <summary> /// Called before the action method is invoked. /// </summary> /// <param name="context">The action executing context.</param> public override void OnActionExecuting(ActionExecutingContext context) { base.OnActionExecuting(context); BeforeAction?.Invoke(); }