diff --git a/src/Neuroglia.Data.Infrastructure.ResourceOriented.Redis/Services/RedisDatabase.cs b/src/Neuroglia.Data.Infrastructure.ResourceOriented.Redis/Services/RedisDatabase.cs index 5af299a2..5688920b 100644 --- a/src/Neuroglia.Data.Infrastructure.ResourceOriented.Redis/Services/RedisDatabase.cs +++ b/src/Neuroglia.Data.Infrastructure.ResourceOriented.Redis/Services/RedisDatabase.cs @@ -183,7 +183,7 @@ public virtual async Task WatchResourcesAsync(string group, stri if (string.IsNullOrWhiteSpace(version)) throw new ArgumentNullException(nameof(version)); if (string.IsNullOrWhiteSpace(plural)) throw new ArgumentNullException(nameof(plural)); var resourceDefinition = await this.GetDefinitionAsync(group, plural, cancellationToken).ConfigureAwait(false) ?? throw new ProblemDetailsException(ResourceProblemDetails.ResourceDefinitionNotFound(new ResourceDefinitionReference(group, version, plural))); - var observable = this.ResourceWatchEvents.Where(e => e.Resource.GetGroup() == group && e.Resource.GetVersion() == version && e.Resource.Kind == resourceDefinition.Spec.Names.Kind && string.IsNullOrWhiteSpace(@namespace) || e.Resource.GetNamespace() == @namespace); + var observable = this.ResourceWatchEvents.Where(e => e.Resource.GetGroup() == group && e.Resource.GetVersion() == version && e.Resource.Kind == resourceDefinition.Spec.Names.Kind && (string.IsNullOrWhiteSpace(@namespace) || e.Resource.GetNamespace() == @namespace)); if (labelSelectors?.Any() == true) observable = observable.Where(e => labelSelectors.All(s => s.Selects(e.Resource))); return new ResourceWatch(observable, false); }