Skip to content

},DynamicData.IChangeSetAdaptor{--0,--1})} },DynamicData.ISortedChangeSetAdaptor{--0,--1})}

ObservableCacheEx.Adapt(IObservable>, IChangeSetAdaptor) method

Defined in

Type: ObservableCacheEx Namespace: DynamicData Assembly: DynamicData.dll

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, net471

Overloads

  • 1. public static IObservable<IChangeSet<TObject, TKey>> Adapt<TObject, TKey>(this IObservable<IChangeSet<TObject, TKey>> source, IChangeSetAdaptor<TObject, TKey> adaptor) where TObject : notnull where TKey : notnull
  • 2. public static IObservable<IChangeSet<TObject, TKey>> Adapt<TObject, TKey>(this IObservable<ISortedChangeSet<TObject, TKey>> source, ISortedChangeSetAdaptor<TObject, TKey> adaptor) where TObject : notnull where TKey : notnull

1. Overload

public static IObservable<IChangeSet<TObject, TKey>> Adapt<TObject, TKey>(this IObservable<IChangeSet<TObject, TKey>> source, IChangeSetAdaptor<TObject, TKey> adaptor) where TObject : notnull where TKey : notnull

View source

Summary: Injects a side effect into the changeset stream by calling adaptor.Adapt for every changeset, then forwarding it downstream unchanged.

Type parameters

NameDescription
TObjectThe type of items in the cache.
TKeyThe type of the key.

Parameters

NameTypeDescription
sourceIObservable>The source IObservable<IChangeSet<TObject, TKey>> to observe and adapt.
adaptor[IChangeSetAdaptor](#The [IChangeSetAdaptor](# whose Adapt method is called for each changeset.

Returns: IObservable> -- An observable that emits the same changesets as source, after the adaptor has processed each one.

Remarks

This is a thin wrapper around Rx's Do operator. The adaptor receives each changeset as a side effect; the changeset itself is forwarded downstream unmodified.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or adaptor is null.

See also

2. Overload

public static IObservable<IChangeSet<TObject, TKey>> Adapt<TObject, TKey>(this IObservable<ISortedChangeSet<TObject, TKey>> source, ISortedChangeSetAdaptor<TObject, TKey> adaptor) where TObject : notnull where TKey : notnull

:material-source-branch: View source

Inherited documentation

These docs were inherited from ObservableCacheEx. The member doesn't override them on this type.

Summary: Injects a side effect into the changeset stream by calling adaptor.Adapt for every changeset, then forwarding it downstream unchanged.

Type parameters

NameDescription
TObjectThe type of items in the cache.
TKeyThe type of the key.

Parameters

NameTypeDescription
sourceIObservable>The source IObservable<ISortedChangeSet<TObject, TKey>> to observe and adapt.
adaptor[ISortedChangeSetAdaptor](#The [ISortedChangeSetAdaptor](# whose Adapt method is called for each changeset.

Returns: IObservable> -- An observable that emits the same changesets as source, after the adaptor has processed each one.

Remarks

This overload operates on ISortedChangeSet. Delegates to Rx's Do operator.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or adaptor is null.

See also