25 lines
689 B
C#
25 lines
689 B
C#
namespace Bts.DataStreamCore;
|
|
|
|
using BCG;
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Diagnostics.CodeAnalysis;
|
|
using System.Linq;
|
|
|
|
public class BlueRowEqualityComparer : IEqualityComparer<IBlueRow> {
|
|
public static BlueRowEqualityComparer Instance { get; } = new();
|
|
|
|
public bool Equals(IBlueRow x, IBlueRow y) =>
|
|
x.schema.columnInfo.SequenceEqual(y.schema.columnInfo) &&
|
|
x.Values.Cast<object>().SequenceEqual(y.Values.Cast<object>());
|
|
|
|
public int GetHashCode([DisallowNull] IBlueRow obj) {
|
|
var hash = new HashCode();
|
|
foreach (var v in obj.Values) {
|
|
hash.Add(v?.GetHashCode() ?? 0);
|
|
}
|
|
return hash.ToHashCode();
|
|
}
|
|
}
|