Interface ICacheUpdater<TObject, TKey>
- Namespace
- DynamicData
- Assembly
- DynamicData.dll
Api for updating an intermediate cache.
Use edit to produce singular change set.
NB:The evaluate method is used to signal to any observing operators to reevaluate whether the object still matches downstream operators. This is primarily targeted to inline object changes such as datetime and calculated fields.
public interface ICacheUpdater<TObject, TKey> : IQuery<TObject, TKey> where TObject : notnull where TKey : notnull
Type Parameters
TObject
The type of the object.
TKey
The type of the key.
- Inherited Members
Methods
AddOrUpdate(IEnumerable<KeyValuePair<TKey, TObject>>)
Adds or updates the specified key value pairs.
void AddOrUpdate(IEnumerable<KeyValuePair<TKey, TObject>> keyValuePairs)
Parameters
keyValuePairs
IEnumerable<KeyValuePair<TKey, TObject>>The key value pairs to add or update.
AddOrUpdate(KeyValuePair<TKey, TObject>)
Adds or updates the specified key value pair.
void AddOrUpdate(KeyValuePair<TKey, TObject> item)
Parameters
item
KeyValuePair<TKey, TObject>The key value pair to add or update.
AddOrUpdate(TObject, TKey)
Adds or updates the specified item / key pair.
void AddOrUpdate(TObject item, TKey key)
Parameters
item
TObjectThe item to add or update.
key
TKeyThe key to add or update.
Clear()
Clears all items from the underlying cache.
void Clear()
Clone(IChangeSet<TObject, TKey>)
Clones the change set to the cache.
void Clone(IChangeSet<TObject, TKey> changes)
Parameters
changes
IChangeSet<TObject, TKey>The changes to clone.
GetKey(TObject)
Gets the key associated with the object.
TKey GetKey(TObject item)
Parameters
item
TObjectThe item.
Returns
- TKey
The key for the specified object.
GetKeyValues(IEnumerable<TObject>)
Gets the key values for the specified items.
IEnumerable<KeyValuePair<TKey, TObject>> GetKeyValues(IEnumerable<TObject> items)
Parameters
items
IEnumerable<TObject>The items.
Returns
- IEnumerable<KeyValuePair<TKey, TObject>>
An enumeration of key value pairs of the key and the object.
Refresh()
Sends a signal for operators to recalculate it's state.
void Refresh()
Refresh(IEnumerable<TKey>)
Refreshes the items matching the specified keys.
void Refresh(IEnumerable<TKey> keys)
Parameters
keys
IEnumerable<TKey>The keys.
Refresh(TKey)
Refreshes the item matching the specified key.
void Refresh(TKey key)
Parameters
key
TKeyThe key to refresh.
Remove(IEnumerable<KeyValuePair<TKey, TObject>>)
Removes the specified key value pairs.
void Remove(IEnumerable<KeyValuePair<TKey, TObject>> items)
Parameters
items
IEnumerable<KeyValuePair<TKey, TObject>>The key value pairs to remove.
Remove(IEnumerable<TKey>)
Removes the specified keys.
void Remove(IEnumerable<TKey> keys)
Parameters
keys
IEnumerable<TKey>The keys to remove the values for.
Remove(KeyValuePair<TKey, TObject>)
Removes the specified key value pair.
void Remove(KeyValuePair<TKey, TObject> item)
Parameters
item
KeyValuePair<TKey, TObject>The key value pair to remove.
Remove(TKey)
Remove the specified keys.
void Remove(TKey key)
Parameters
key
TKeyThe key of the item to remove.
RemoveKey(TKey)
Overload of remove due to ambiguous method when TObject and TKey are of the same type.
void RemoveKey(TKey key)
Parameters
key
TKeyThe key.
RemoveKeys(IEnumerable<TKey>)
Overload of remove due to ambiguous method when TObject and TKey are of the same type.
void RemoveKeys(IEnumerable<TKey> key)
Parameters
key
IEnumerable<TKey>The key.
Update(IChangeSet<TObject, TKey>)
Updates using changes using the specified change set.
[Obsolete("Use Clone()")]
void Update(IChangeSet<TObject, TKey> changes)
Parameters
changes
IChangeSet<TObject, TKey>The changes to update with.