Skip to content

ObservableCacheEx class

Defined in

Namespace: DynamicData Assembly: DynamicData.dll Full name: DynamicData.ObservableCacheEx Modifiers: public static

Summary

View source

        ObservableCache extensions for the virtualised group of operators.
        

Applies to

net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, netstandard2.0, net462

Methods

NameSummary
static AdaptInject side effects into the stream using the specified adaptor.
static AddOrUpdateAdds or updates the cache with the specified item.
static AndApplied a logical And operator between the collections i.e items which are in all of the sources are included.
static AsObservableCacheConverts the source to an read only observable cache.
static AsyncDisposeManyAutomatically disposes items within the source collection, upon removal of the collection or teardown of the operator.
static AutoRefreshAutomatically refresh downstream operators when any properties change.
static AutoRefreshOnObservableAutomatically refresh downstream operator. The refresh is triggered when the observable receives a notification.
static BatchBatches the updates for the specified time period.
static BatchIfBatches the underlying updates if a pause signal (i.e when the buffer selector return true) has been received. When a resume signal has been received the batched updates will be fired.
static BindBinds the results to the specified observable collection using the default update algorithm.
static BufferInitialBuffers changes for an initial period only. After the period has elapsed, not further buffering occurs.
static CastCast the object to the specified type. Alas, I had to add the converter due to type inference issues.
static ChangeKeyChanges the primary key.
static ClearClears all data.
static CloneClones the changes into the specified collection.
static ConvertConvert the object using the specified conversion function. This is a lighter equivalent of Transform and is designed to be used with non-disposable objects.
static DeferUntilLoadedDefer the subscription until the stream has been inflated with data.
static DisposeManyDisposes each item when no longer required.
static DistinctValuesSelects distinct values from the source.
static EditDiffLoads the cache with the specified items in an optimised manner i.e. calculates the differences between the old and new items in the list and amends only the differences.
static EnsureUniqueKeysEnsures there are no duplicated keys in the observable changeset.
static ExceptDynamically apply a logical Except operator between the collections Items from the first collection in the outer list are included unless contained in any of the other lists.
static ExpireAfterAutomatically removes items from the stream after the time specified by the timeSelector elapses. Return null if the item should never be removed.
static FilterFilters the specified source.
static FilterImmutableCreates a filtered stream, optimized for stateless/deterministic filtering of immutable items.
static FilterOnObservableFilters the stream of changes according to an Observable bool that is created for each item using the specified factory function.
static FinallySafeEnsure that finally is always called. Thanks to Lee Campbell for this.
static FlattenFlattens an update collection to it's individual items.
static FlattenBufferResultConvert the result of a buffer operation to a single change set.
static ForEachChangeProvides a call back for each change.
static FullJoinJoins the left and right observable data sources, taking any left or right values and matching them, provided that the left or the right has a value. This is the equivalent of SQL full...
static FullJoinManyGroups the right data source and joins the resulting group to the left data source, matching these using the specified key selector. Results are included when the left or the right has a value. ...
static GroupGroups the source on the value returned by group selector factory. A group is included for each item in the resulting group source.
static GroupOnObservableGroups the source by the latest value from their observable created by the given factory.
static GroupOnPropertyGroups the source using the property specified by the property selector. Groups are re-applied when the property value changed.
static GroupOnPropertyWithImmutableStateGroups the source using the property specified by the property selector. Each update produces immutable grouping. Groups are re-applied when the property value changed.
static GroupWithImmutableStateGroups the source on the value returned by group selector factory. Each update produces immutable grouping.
static IgnoreSameReferenceUpdateIgnores updates when the update is the same reference.
static IgnoreUpdateWhenIgnores the update when the condition is met. The first parameter in the ignore function is the current value and the second parameter is the previous value.
static IncludeUpdateWhenOnly includes the update when the condition is met. The first parameter in the ignore function is the current value and the second parameter is the previous value.
static InnerJoinJoins the left and right observable data sources, taking values when both left and right values are present This is the equivalent of SQL inner join.
static InnerJoinManyGroups the right data source and joins the resulting group to the left data source, matching these using the specified key selector. Results are included when the left and right have matching values....
static InvokeEvaluateInvokes Refresh method for an object which implements IEvaluateAware.
static LeftJoinJoins the left and right observable data sources, taking all left values and combining any matching right values.
static LeftJoinManyGroups the right data source and joins the two sources matching them using the specified key selector, taking all left values and combining any matching right values. This is the...
static LimitSizeToApplies a size limiter to the number of records which can be included in the underlying cache. When the size limit is reached the oldest items are removed.
static MergeManyDynamically merges the observable which is selected from each item in the stream, and un-merges the item when it is no longer part of the stream.
static MergeChangeSetsOperator similar to Merge except it is ChangeSet aware. All of the observable changesets are merged together into a single stream of ChangeSet events that correctly handles multiple Keys.
static MergeManyChangeSetsOperator similar to MergeMany except it is ChangeSet aware. It uses observableSelector to transform each item in the source into a child [IChangeSet](# and merges the...
static MergeManyItemsDynamically merges the observable which is selected from each item in the stream, and un-merges the item when it is no longer part of the stream.
static MonitorStatusMonitors the status of a stream.
static NotEmptySuppresses updates which are empty.
static OfTypeFilters an observable changeset so that it only includes items that are of type TDestination.
static OnItemAddedCallback for each item as and when it is being added to the stream.
static OnItemRefreshedCallback for each item as and when it is being refreshed in the stream.
static OnItemRemovedCallback for each item/key as and when it is being removed from the stream.
static OnItemUpdatedCallback when an item has been updated eg. (current, previous)=>{}.
static OrApply a logical Or operator between the collections i.e items which are in any of the sources are included.
static PopulateFromPopulate a cache from an observable stream.
static PopulateIntoPopulates a source into the specified cache.
static QueryWhenChangedThe latest copy of the cache is exposed for querying after each modification to the underlying data.
static RefCountCache equivalent to Publish().RefCount(). The source is cached so long as there is at least 1 subscriber.
static RefreshSignal observers to re-evaluate the specified item.
static RemoveRemoves the specified item from the cache.
static RemoveKeyRemoves the key which enables all observable list features of dynamic data.
static RemoveKeysRemoves the specified keys from the cache. Any keys not contained in the cache are ignored.
static RightJoinJoins the left and right observable data sources, taking all right values and combining any matching left values.
static RightJoinManyGroups the right data source and joins the two sources matching them using the specified key selector, , taking all right values and combining any matching left values. This is the...
static SkipInitialDefer the subscription until loaded and skip initial change set.
static SortSorts using the specified comparer. Returns the underlying ChangeSet as per the system conventions. The resulting change set also exposes a sorted key value collection of...
static SortBySorts a sequence by selected property.
static StartWithEmptyPrepends an empty change set to the source.
static StartWithItemThe equivalent of rx StartsWith operator, but wraps the item in a change where reason is ChangeReason.Add.
static SubscribeManySubscribes to each item when it is added to the stream and un-subscribes when it is removed. All items will be unsubscribed when the stream is disposed.
static SuppressRefreshSuppress refresh notifications.
static SwitchTransforms an observable sequence of observable caches into a single sequence producing values only from the most recent observable sequence. Each time a new inner...
static ToCollectionConverts the change set into a fully formed collection. Each change in the source results in a new collection.
static ToObservableChangeSetConverts the observable to an observable change set. Change set observes observable change events.
static ToObservableOptionalConverts an observable change set into an observable optional that emits the value for the given key.
static ToSortedCollectionConverts the change set into a fully formed sorted collection. Each change in the source results in a new sorted collection.
static TransformProjects each update item to a new form using the specified transform function.
static TransformAsyncProjects each update item to a new form using the specified transform function.
static TransformImmutableProjects each update item to a new form using the specified transform function, with optimizations for stateless/deterministic transformation of immutable items.
static TransformManyEquivalent to a select many transform. To work, the key must individually identify each child.
static TransformManyAsyncExtension method similar to [TransformMany][M:DynamicData.ObservableCacheEx.TransformMany--4(System.IObservable},System.Func{--2,System.Collections.Generic.IEnumerable{...
static TransformManySafeAsyncExtension method similar to [TransformManyAsync][M:DynamicData.ObservableCacheEx.TransformManyAsync--4(System.IObservable},System.Func{--2,--3,System.Threading.Tasks.Ta...
static TransformOnObservableTransforms each item in the ChangeSet into an Observable that provides the value for the Resulting ChangeSet.
static TransformSafeProjects each update item to a new form using the specified transform function, providing an error handling action to safely handle transform errors without killing the stream.
static TransformSafeAsyncProjects each update item to a new form using the specified transform function.
static TransformToTreeTransforms the object to a fully recursive tree, create a hierarchy based on the pivot function.
static TransformWithInlineUpdateProjects each update item to a new form using the specified transform function and when an update is received, allows the preservation of the previous instance.
static TreatMovesAsRemoveAddConverts moves changes to remove + add.
static TrueForAllProduces a boolean observable indicating whether the latest resulting value from all of the specified observables matches the equality condition. The observable is re-evaluated whenever.
static TrueForAnyProduces a boolean observable indicating whether the resulting value of whether any of the specified observables matches the equality condition. The observable is re-evaluated whenever ...
static UpdateIndexUpdates the index for an object which implements IIndexAware.
static WatchReturns an observable of any updates which match the specified key, proceeded with the initial cache state.
static WatchValueWatches updates for a single value matching the specified key.
static WhenAnyPropertyChangedWatches each item in the collection and notifies when any of them has changed.
static WhenPropertyChangedWatches each item in the collection and notifies when any of them has changed.
static WhenValueChangedWatches each item in the collection and notifies when any of them has changed.
static WhereReasonsAreIncludes changes for the specified reasons only.
static WhereReasonsAreNotExcludes updates for the specified reasons.
static XorApply a logical Xor operator between the collections. Items which are only in one of the sources are included in the result.
static SortAndBindBind sorted data to the specified collection, for an object which implements IComparableTObject>.
static SortAndVirtualizeSort and virtualize the underlying data from the specified source.
static VirtualiseVirtualises the underlying data from the specified source.
static TopLimits the size of the result set to the specified number, ordering by the comparer.
static SortAndPageSort and page the underlying data from the specified source.
static PageReturns the page as specified by the pageRequests observable.
Inherited members