Exemplo n.º 1
0
        /// <summary>
        /// Matches underlying rows with provided primary key value(s) from other DataSet.
        /// </summary>
        /// <param name="columns">The columns of other DataSet's primary key.</param>
        /// <param name="dataRow">The DataRow of other DataSet.</param>
        /// <returns>The matched <see cref="RowPresenter"/>, <see langword="null"/> if no matched row.</returns>
        public RowPresenter Match(IReadOnlyList <Column> columns, DataRow dataRow = null)
        {
            columns.VerifyNotNull(nameof(columns));
            if (!CanMatchRow)
            {
                return(null);
            }

            var valueHashCode = RowMatch.GetHashCode(columns, dataRow);

            if (!valueHashCode.HasValue)
            {
                return(null);
            }
            return(LayoutManager[new RowMatch(columns, dataRow, valueHashCode.Value)]);
        }
Exemplo n.º 2
0
 private int?GetMatchValueHashCode()
 {
     return(_rowMapper == null || !_rowMapper.CanMatchRow || DataRow == null || DataRow.IsAdding ? null : RowMatch.GetHashCode(MatchColumns, DataRow));
 }