public static void InvokeEvents<TDelegate>(this ILifecycleEventService lifecycleService, string eventName, Action<TDelegate> action) where TDelegate : Delegate { var delegates = lifecycleService.GetEventDelegates<TDelegate>(eventName); foreach (var del in delegates) action?.Invoke(del); }
public static void InvokeEvents(this ILifecycleEventService lifecycleService, string eventName) => lifecycleService.InvokeEvents <Action>(eventName, action => action?.Invoke());