Show / Hide Table of Contents

    Class BulkUpdateBase

    Common base class for BulkUpdate.

    Inheritance
    System.Object
    BulkUpdateBase
    SqlServerBulkUpdate
    Implements
    IBulkUpdate
    Namespace: Kros.Data.BulkActions
    Assembly: Kros.Utils.dll
    Syntax
    public abstract class BulkUpdateBase : IBulkUpdate, IDisposable

    Fields

    _connection

    Connection.

    Declaration
    protected IDbConnection _connection
    Field Value
    Type Description
    System.Data.IDbConnection

    _disposeOfConnection

    true if dispose of the connection is necessary, otherwise false.

    Declaration
    protected bool _disposeOfConnection
    Field Value
    Type Description
    System.Boolean

    PrefixTempTable

    Temporary table prefix.

    Declaration
    protected const char PrefixTempTable = '#'
    Field Value
    Type Description
    System.Char

    Properties

    DestinationTableName

    Destination table name in database.

    Declaration
    public string DestinationTableName { get; set; }
    Property Value
    Type Description
    System.String

    ExternalTransaction

    External transaction in which the operation is executed.

    Declaration
    public IDbTransaction ExternalTransaction { get; protected set; }
    Property Value
    Type Description
    System.Data.IDbTransaction

    PrimaryKeyColumn

    Primary key.

    Declaration
    public string PrimaryKeyColumn { get; set; }
    Property Value
    Type Description
    System.String

    TempTableAction

    Declaration
    public Action<IDbConnection, IDbTransaction, string> TempTableAction { get; set; }
    Property Value
    Type Description
    System.Action<System.Data.IDbConnection, System.Data.IDbTransaction, System.String>

    Methods

    CreateBulkInsert()

    Creates BulkInsert.

    Declaration
    protected abstract IBulkInsert CreateBulkInsert()
    Returns
    Type Description
    IBulkInsert

    Bulk insert.

    CreateCommandForPrimaryKey()

    Returns command for creating primary key.

    Declaration
    protected abstract IDbCommand CreateCommandForPrimaryKey()
    Returns
    Type Description
    System.Data.IDbCommand

    CreateTempTable(IDataReader, String)

    Creates temporary table by reader.

    Declaration
    protected abstract void CreateTempTable(IDataReader reader, string tempTableName)
    Parameters
    Type Name Description
    System.Data.IDataReader reader

    Reader for accessing data.

    System.String tempTableName

    Name of temporary table.

    Dispose()

    Declaration
    public void Dispose()

    Dispose(Boolean)

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing

    DoneTempTableAsync(String, Boolean)

    Ends work with temporary table.

    Declaration
    protected virtual Task DoneTempTableAsync(string tempTableName, bool useAsync)
    Parameters
    Type Name Description
    System.String tempTableName

    Temporary table name.

    System.Boolean useAsync

    true if action can by executed asynchronously.

    Returns
    Type Description
    System.Threading.Tasks.Task

    GetColumnNamesForTempTable(IDataReader)

    List of temporary table columns.

    Declaration
    protected string GetColumnNamesForTempTable(IDataReader reader)
    Parameters
    Type Name Description
    System.Data.IDataReader reader

    Reader for accesing data.

    Returns
    Type Description
    System.String

    GetTempTableName()

    Returns name of temporary table.

    Declaration
    protected abstract string GetTempTableName()
    Returns
    Type Description
    System.String

    GetTempTableNameForBulkInsert(String)

    Returns formatted name of temporary table for BulkInsert.

    Declaration
    protected virtual string GetTempTableNameForBulkInsert(string name)
    Parameters
    Type Name Description
    System.String name

    Temporary table name.

    Returns
    Type Description
    System.String

    GetUpdateColumnNames(IDataReader, String)

    List of temporary table columns.

    Declaration
    protected string GetUpdateColumnNames(IDataReader reader, string tempTableName)
    Parameters
    Type Name Description
    System.Data.IDataReader reader

    Reader for accesing data.

    System.String tempTableName

    Temporary table name.

    Returns
    Type Description
    System.String

    InvokeAction(String)

    Invokes action in temporary database.

    Declaration
    protected abstract void InvokeAction(string tempTableName)
    Parameters
    Type Name Description
    System.String tempTableName

    Name of temporary table.

    Update(IBulkActionDataReader)

    Declaration
    public void Update(IBulkActionDataReader reader)
    Parameters
    Type Name Description
    IBulkActionDataReader reader

    Update(DataTable)

    Declaration
    public void Update(DataTable table)
    Parameters
    Type Name Description
    System.Data.DataTable table

    Update(IDataReader)

    Declaration
    public void Update(IDataReader reader)
    Parameters
    Type Name Description
    System.Data.IDataReader reader

    UpdateAsync(IBulkActionDataReader)

    Declaration
    public Task UpdateAsync(IBulkActionDataReader reader)
    Parameters
    Type Name Description
    IBulkActionDataReader reader
    Returns
    Type Description
    System.Threading.Tasks.Task

    UpdateAsync(DataTable)

    Declaration
    public Task UpdateAsync(DataTable table)
    Parameters
    Type Name Description
    System.Data.DataTable table
    Returns
    Type Description
    System.Threading.Tasks.Task

    UpdateAsync(IDataReader)

    Declaration
    public Task UpdateAsync(IDataReader reader)
    Parameters
    Type Name Description
    System.Data.IDataReader reader
    Returns
    Type Description
    System.Threading.Tasks.Task

    UpdateDestinationTableAsync(IDataReader, String, Boolean)

    Executes update on destination table.

    Declaration
    protected abstract Task UpdateDestinationTableAsync(IDataReader reader, string tempTableName, bool useAsync)
    Parameters
    Type Name Description
    System.Data.IDataReader reader

    Reader for accesing data.

    System.String tempTableName

    Temporary table name.

    System.Boolean useAsync

    true if action can by executed asynchronously.

    Returns
    Type Description
    System.Threading.Tasks.Task

    Implements

    IBulkUpdate
    Back to top KROS a.s.