System.Data.DataTable.UpdatingAdd C# (CSharp) Method

UpdatingAdd() private method

private UpdatingAdd ( object values ) : DataRow
values object
return DataRow
        internal DataRow UpdatingAdd(object[] values)
        {
            Index index = null;
            if (_primaryKey != null)
            {
                index = _primaryKey.Key.GetSortIndex(DataViewRowState.OriginalRows);
            }

            if (index != null)
            {
                int record = NewRecordFromArray(values);
                int result = index.FindRecord(record);
                if (result != -1)
                {
                    int resultRecord = index.GetRecord(result);
                    DataRow row = _recordManager[resultRecord];
                    Debug.Assert(row != null, "Row can't be null for index record");
                    row.RejectChanges();
                    SetNewRecord(row, record);
                    return row;
                }
                DataRow row2 = NewRow(record);
                Rows.Add(row2);
                return row2;
            }

            return Rows.Add(values);
        }
DataTable