ProSol.Html.TagsProvider/src/Messaging/IPublisherExtensions.cs
Alexander Kozachenko 5598d0f898 refactoring #6 (#7)
refactoring #6

Co-authored-by: Alexander Kozachenko <119358312+Alex-Kozachenko@users.noreply.github.com>
Reviewed-on: #7
2023-12-08 01:46:37 +00:00

18 lines
579 B
C#

using ProSol.Html.Contracts.Data;
using ProSol.Messaging;
using ProSol.Messaging.Filtering;
namespace ProSol.Html.Messaging;
public static class IPublisherExtensions
{
public static IPublisher<TagsProviderMessage> Filter(
this IPublisher<TagsProviderMessage> publisher,
string tagName)
=> publisher.Filter([tagName]);
public static IPublisher<TagsProviderMessage> Filter(
this IPublisher<TagsProviderMessage> publisher,
params string[] tagNames)
=> publisher.Filter(x => tagNames.Contains(x.CurrentTag.TagInfo.Name));
}