/// <summary> /// Revalidate the caches with provided revalidateKeys /// </summary> /// <param name="revalidatedKeys"></param> public static void RevalidateCaches(List <string> revalidatedKeys) { foreach (var key in revalidatedKeys) { RevalidateEvent?.Invoke(key); } }
/// <summary> /// Async notify revalidation events /// </summary> /// <param name="revalidateKeys"></param> /// <returns></returns> public static Task RevalidateCachesAsync(List <string> revalidateKeys) { if (RevalidateEvent != null) { return(Task.WhenAll( revalidateKeys.Select(k => Task.Run(() => { RevalidateEvent?.Invoke(k); })) )); } return(TaskHelpers.DefaultCompleted); }