public Task <bool> Any(Action <PublishedMessageFilter> apply = default, CancellationToken cancellationToken = default) { var messageFilter = new PublishedMessageFilter(); apply?.Invoke(messageFilter); return(Any(message => messageFilter.Any(message), cancellationToken)); }
public IAsyncEnumerable <IPublishedMessage> SelectAsync(Action <PublishedMessageFilter> apply, CancellationToken cancellationToken = default) { var messageFilter = new PublishedMessageFilter(); apply?.Invoke(messageFilter); return(SelectAsync(message => messageFilter.Any(message), cancellationToken)); }
public Task <bool> Any <T>(FilterDelegate <IPublishedMessage <T> > filter, CancellationToken cancellationToken = default) where T : class { var messageFilter = new PublishedMessageFilter(); messageFilter.Includes.Add(filter); return(Any(message => messageFilter.Any(message), cancellationToken)); }
public IAsyncEnumerable <IPublishedMessage <T> > SelectAsync <T>(FilterDelegate <IPublishedMessage <T> > filter, CancellationToken cancellationToken = default) where T : class { var messageFilter = new PublishedMessageFilter(); messageFilter.Includes.Add(filter); return(SelectAsync(message => messageFilter.Any(message), cancellationToken).Select <IPublishedMessage, IPublishedMessage <T> >()); }