public void UpdateMatchingRowsWithFieldsValuesFrom(IEnumerable <RowLoadResult> otherRows) { foreach (RowLoadResult rowLoadResult in otherRows) { RowLoadResult match = GetRowWithMatchingIdentifier(rowLoadResult); match.Fields = rowLoadResult.Fields; } }
public bool HasDifferentFieldValues(RowLoadResult other) => Fields.Any(x => other.Fields.Any(y => y.Key == x.Key && y.Value?.Equals(x.Value) == false));
public RowLoadResult GetRowWithMatchingIdentifier(RowLoadResult other) => Rows?.FirstOrDefault(_ => _.HasSameIdentifier(other));
public bool HasSameIdentifier(RowLoadResult other) => Identifier == other?.Identifier && IdentifierFieldType == other?.IdentifierFieldType;