Exemplo n.º 1
0
        private ushort[] FindOrAssignLIDs(DataBlock.ReadOnlyDataBlock values, int idColumnIndex, AddOrUpdateMode mode)
        {
            Type idColumnDataType = values.GetTypeForColumn(idColumnIndex);

            // If the insert array matches types with the column then we can use the native type to do a direct assignment from the input array
            // to the column array.  If the types do not match, we need to fallback to object to allow the Value class to handle the type conversion
            ITypedAddOrUpdateWorker worker = NativeContainer.CreateTypedInstance <ITypedAddOrUpdateWorker>(typeof(AddOrUpdateWorker <>), idColumnDataType);

            return(worker.FindOrAssignLIDs(this, values, idColumnIndex, mode));
        }
Exemplo n.º 2
0
        private void FillPartitionColumn(DataBlock.ReadOnlyDataBlock values, int columnIndex, ushort[] itemLIDs)
        {
            string columnName = values.Columns[columnIndex].Name;

            if (columnName.Equals(this.IDColumn.Name, StringComparison.OrdinalIgnoreCase))
            {
                return;
            }

            Type dataBlockColumnDataType = values.GetTypeForColumn(columnIndex);

            // If the insert array matches types with the column then we can use the native type to do a direct assignment from the input array
            // to the column array.  If the types do not match, we need to fallback to object to allow the Value class to handle the type conversion
            ITypedAddOrUpdateWorker worker = NativeContainer.CreateTypedInstance <ITypedAddOrUpdateWorker>(typeof(AddOrUpdateWorker <>), dataBlockColumnDataType);

            worker.FillPartitionColumn(this, values, columnIndex, itemLIDs);
        }