Struct Change<TObject, TKey>
- Namespace
- Dynamic
Data
- Assembly
- DynamicData.dll
Container to describe a single change to a cache.
public readonly struct Change<TObject, TKey> : IEquatable<Change<TObject, TKey>> where TObject : notnull where TKey : notnull
Type Parameters
TObject
The type of the object.
TKey
The type of the key.
- Implements
-
IEquatable<Change<TObject, TKey>>
- Extension Methods
Constructors
Change(ChangeReason, TKey, TObject, in Optional<TObject>, int, int)
Initializes a new instance of the Change<TObject, TKey> struct.
public Change(ChangeReason reason, TKey key, TObject current, in Optional<TObject> previous, int currentIndex = -1, int previousIndex = -1)
Parameters
reason
ChangeReason The reason.
key
TKeyThe key.
current
TObjectThe current.
previous
Optional<TObject>The previous.
currentIndex
intValue of the current.
previousIndex
intValue of the previous.
Exceptions
- Argument
Exception For ChangeReason.Add, a previous value cannot be specified or For ChangeReason.Change, must supply previous value.
Change(ChangeReason, TKey, TObject, int)
Initializes a new instance of the Change<TObject, TKey> struct.
Parameters
reason
ChangeReason The reason.
key
TKeyThe key.
current
TObjectThe current.
index
intThe index.
Change(TKey, TObject, int, int)
Initializes a new instance of the Change<TObject, TKey> struct. Constructor for ChangeReason.Move.
Parameters
key
TKeyThe key.
current
TObjectThe current.
currentIndex
intThe CurrentIndex.
previousIndex
intCurrentIndex of the previous.
Exceptions
- Argument
Exception CurrentIndex must be greater than or equal to zero or PreviousIndex must be greater than or equal to zero.
Properties
Current
Gets the item which has changed.
Property Value
- TObject
CurrentIndex
Gets the current index.
Property Value
Key
Gets the unique key of the item which has changed.
Property Value
- TKey
Previous
Gets the previous change.
This is only when Reason==ChangeReason.Replace.
Property Value
- Optional<TObject>
PreviousIndex
Gets the previous change.
This is only when Reason==ChangeReason.Update or ChangeReason.Move.
Property Value
Reason
Gets the reason for the change.
Property Value
Methods
Equals(Change<TObject, TKey>)
Parameters
other
Change<TObject, TKey>
Returns
Equals(object?)
Parameters
obj
object
Returns
GetHashCode()
Returns
ToString()
Returns
Operators
operator ==(in Change<TObject, TKey>, in Change<TObject, TKey>)
Determines whether the specified objects are equal.
Parameters
left
Change<TObject, TKey>The left value to compare.
right
Change<TObject, TKey>The right value to compare.
Returns
- bool
If the two values are equal to each other.
operator !=(in Change<TObject, TKey>, in Change<TObject, TKey>)
Determines whether the specified objects are equal.
Parameters
left
Change<TObject, TKey>The left value to compare.
right
Change<TObject, TKey>The right value to compare.
Returns
- bool
If the two values are not equal to each other.