GetDifferences<T>(HashSet<T>, HashSet<T>, PropertyEqualityComparer<T>, PropertyEqualityComparer<T>, bool) Method
Compares two sets of data entities and identifies the added, deleted, and edited entries.

Syntax

public Result<T> GetDifferences<T>(HashSet<T> sourceList, HashSet<T> destinationList, PropertyEqualityComparer<T> keyComparer, PropertyEqualityComparer<T> CompariablePropertyComparer, bool DetailedComparison = true)

Type Parameters

Name Description
T

Parameters

Name Type Description
sourceList HashSet<T> The source set of data entities.
destinationList HashSet<T> The destination set of data entities.
keyComparer PropertyEqualityComparer<T> An equality comparer for identifying key properties.
CompariablePropertyComparer PropertyEqualityComparer<T> An equality comparer for identifying properties used in the comparison.
DetailedComparison bool Specifies whether to include detailed comparison results for each property change. Default is true.

Return Value

Type Description
Result<T> A object containing the added, deleted, and edited entries. For detailed comparisons, it includes information about individual property changes in the property; otherwise, edited entries are listed in the property.

See Also