diff --git a/src/DynamicData.Tests/API/ApiApprovalTests.DynamicDataTests.DotNet9_0.verified.txt b/src/DynamicData.Tests/API/ApiApprovalTests.DynamicDataTests.DotNet9_0.verified.txt index fba40fd2..a3c37fc8 100644 --- a/src/DynamicData.Tests/API/ApiApprovalTests.DynamicDataTests.DotNet9_0.verified.txt +++ b/src/DynamicData.Tests/API/ApiApprovalTests.DynamicDataTests.DotNet9_0.verified.txt @@ -279,9 +279,6 @@ namespace DynamicData.Alias public static System.IObservable> Where(this System.IObservable> source, System.IObservable> predicateChanged) where TObject : notnull where TKey : notnull { } - public static System.IObservable> Where(this System.IObservable> source, System.IObservable reapplyFilter) - where TObject : notnull - where TKey : notnull { } public static System.IObservable> Where(this System.IObservable> source, System.IObservable> predicateChanged, System.IObservable reapplyFilter) where TObject : notnull where TKey : notnull { } @@ -1326,9 +1323,6 @@ namespace DynamicData public static System.IObservable> Filter(this System.IObservable> source, System.IObservable> predicateChanged, bool suppressEmptyChangeSets = true) where TObject : notnull where TKey : notnull { } - public static System.IObservable> Filter(this System.IObservable> source, System.IObservable reapplyFilter, bool suppressEmptyChangeSets = true) - where TObject : notnull - where TKey : notnull { } public static System.IObservable> Filter(this System.IObservable> source, System.IObservable> predicateChanged, System.IObservable reapplyFilter, bool suppressEmptyChangeSets = true) where TObject : notnull where TKey : notnull { } diff --git a/src/DynamicData.Tests/Cache/FilterControllerFixture.cs b/src/DynamicData.Tests/Cache/FilterControllerFixture.cs index ebe07324..940c5f77 100644 --- a/src/DynamicData.Tests/Cache/FilterControllerFixture.cs +++ b/src/DynamicData.Tests/Cache/FilterControllerFixture.cs @@ -162,7 +162,10 @@ public void ReapplyFilterDoesntThrow() using var source = new SourceCache(p => p.Key); source.AddOrUpdate(Enumerable.Range(1, 100).Select(i => new Person("P" + i, i)).ToArray()); - var ex = Record.Exception(() => source.Connect().Filter(Observable.Return(Unit.Default)).AsObservableCache()); + var ex = Record.Exception(() => source.Connect().Filter( + predicateChanged: Observable.Return>(static _ => true), + reapplyFilter: Observable.Return(Unit.Default)) + .AsObservableCache()); Assert.Null(ex); } diff --git a/src/DynamicData/Alias/ObservableCacheAlias.cs b/src/DynamicData/Alias/ObservableCacheAlias.cs index 76757476..cf10aa4d 100644 --- a/src/DynamicData/Alias/ObservableCacheAlias.cs +++ b/src/DynamicData/Alias/ObservableCacheAlias.cs @@ -292,24 +292,6 @@ public static IObservable> Where(this I return source.Filter(predicateChanged); } - /// - /// Creates a filtered stream which can be dynamically filtered. - /// - /// The type of the object. - /// The type of the key. - /// The source. - /// Observable to re-evaluate whether the filter still matches items. Use when filtering on mutable values. - /// An observable which emits the change set. - public static IObservable> Where(this IObservable> source, IObservable reapplyFilter) - where TObject : notnull - where TKey : notnull - { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - reapplyFilter.ThrowArgumentNullExceptionIfNull(nameof(reapplyFilter)); - - return source.Filter(reapplyFilter); - } - /// /// Creates a filtered stream which can be dynamically filtered. /// diff --git a/src/DynamicData/Cache/ObservableCacheEx.cs b/src/DynamicData/Cache/ObservableCacheEx.cs index 308b2dc0..b620a248 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.cs @@ -1542,25 +1542,6 @@ public static IObservable> Filter - /// Creates a filtered stream which can be dynamically filtered. - /// - /// The type of the object. - /// The type of the key. - /// The source. - /// Observable to re-evaluate whether the filter still matches items. Use when filtering on mutable values. - /// By default empty changeset notifications are suppressed for performance reasons. Set to false to publish empty changesets. Doing so can be useful for monitoring loading status. - /// An observable which emits change sets. - public static IObservable> Filter(this IObservable> source, IObservable reapplyFilter, bool suppressEmptyChangeSets = true) - where TObject : notnull - where TKey : notnull - { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - reapplyFilter.ThrowArgumentNullExceptionIfNull(nameof(reapplyFilter)); - - return source.Filter(Observable.Empty>(), reapplyFilter, suppressEmptyChangeSets); - } - /// /// Creates a filtered stream which can be dynamically filtered. ///