Show / Hide Table of Contents

    Interface ICommandGenerator<T>

    Iterface, which describes generating single-table commands that are used to commit changes made to a DbSet with the associated database.

    Namespace: Kros.KORM.CommandGenerator
    Assembly: Kros.KORM.dll
    Syntax
    public interface ICommandGenerator<T>
    Type Parameters
    Name Description
    T

    Methods

    FillCommand(DbCommand, T)

    Fills command's parameters with values from item.

    Declaration
    void FillCommand(DbCommand command, T item)
    Parameters
    Type Name Description
    System.Data.Common.DbCommand command

    Command which parameters are filled.

    T item

    Item, from which command is filled.

    Exceptions
    Type Condition
    System.ArgumentNullException

    Either command or item is null.

    GetColumnValue(ColumnInfo, T)

    Gets value from the specific column.

    Declaration
    object GetColumnValue(ColumnInfo columnInfo, T item)
    Parameters
    Type Name Description
    ColumnInfo columnInfo

    The specific column.

    T item

    The item whose value will be returned.

    Returns
    Type Description
    System.Object

    Value from the specific column.

    GetDeleteCommand()

    Gets the automatically generated DbCommand object required to perform deletions on the database.

    Declaration
    DbCommand GetDeleteCommand()
    Returns
    Type Description
    System.Data.Common.DbCommand

    Delete command.

    Exceptions
    Type Condition
    MissingPrimaryKeyException

    GetDeleteCommand doesn't supported when entity doesn't have primary key.

    GetDeleteCommands(IEnumerable<T>)

    Gets the automatically generated DbCommands object required to perform deletions on the database.

    Declaration
    IEnumerable<DbCommand> GetDeleteCommands(IEnumerable<T> items)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<T> items

    Type class of model collection.

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<System.Data.Common.DbCommand>

    Delete command collection.

    Exceptions
    Type Condition
    MissingPrimaryKeyException

    GetDeleteCommands doesn't supported when entity doesn't have primary key.

    GetInsertCommand()

    Gets the automatically generated DbCommand object required to perform insertions on the database.

    Declaration
    DbCommand GetInsertCommand()
    Returns
    Type Description
    System.Data.Common.DbCommand

    Insert command.

    GetQueryColumns()

    Get columns for query.

    Declaration
    IEnumerable<ColumnInfo> GetQueryColumns()
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<ColumnInfo>

    GetUpdateCommand()

    Gets the automatically generated DbCommand object required to perform updates on the database

    Declaration
    DbCommand GetUpdateCommand()
    Returns
    Type Description
    System.Data.Common.DbCommand

    Update command.

    Exceptions
    Type Condition
    MissingPrimaryKeyException

    GetUpdateCommand doesn't supported when entity doesn't have primary key.

    Back to top KROS a.s.