コード例 #1
0
ファイル: DataPresenter.cs プロジェクト: xydoublez/RDO.Net
        /// <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)]);
        }
コード例 #2
0
ファイル: RowPresenter.cs プロジェクト: xydoublez/RDO.Net
 private int?GetMatchValueHashCode()
 {
     return(_rowMapper == null || !_rowMapper.CanMatchRow || DataRow == null || DataRow.IsAdding ? null : RowMatch.GetHashCode(MatchColumns, DataRow));
 }