Search Results for

    Show / Hide Table of Contents

    Class Table<TEntity>

    A Table<TEntity> is used to perform CRUD operations against the table represented by TEntity.

    Inheritance
    Object
    TableBase<TEntity>
    Table<TEntity>
    Inherited Members
    TableBase<TEntity>.QueryAsync<TReturn>(IQueryCommand<TEntity, TReturn>, CancellationToken)
    TableBase<TEntity>.QuerySingle(String, Boolean)
    TableBase<TEntity>.QuerySingle(Expression<Func<TEntity, FormattableString>>, Boolean)
    TableBase<TEntity>.QuerySingle<TOne>(Expression<Func<TEntity, TOne, FormattableString>>, Boolean)
    TableBase<TEntity>.QuerySingle<TOne, Two>(Expression<Func<TEntity, TOne, Two, FormattableString>>, Boolean)
    TableBase<TEntity>.QuerySingle<TOne, Two, TThree>(Expression<Func<TEntity, TOne, Two, TThree, FormattableString>>, Boolean)
    TableBase<TEntity>.QuerySingle<TOne, Two, TThree, TFour>(Expression<Func<TEntity, TOne, Two, TThree, TFour, FormattableString>>, Boolean)
    TableBase<TEntity>.QuerySingle<TOne, Two, TThree, TFour, TFive>(Expression<Func<TEntity, TOne, Two, TThree, TFour, TFive, FormattableString>>, Boolean)
    TableBase<TEntity>.QuerySingle<TOne, Two, TThree, TFour, TFive, TSix>(Expression<Func<TEntity, TOne, Two, TThree, TFour, TFive, TSix, FormattableString>>, Boolean)
    TableBase<TEntity>.QuerySingle<TOne, Two, TThree, TFour, TFive, TSix, TSeven>(Expression<Func<TEntity, TOne, Two, TThree, TFour, TFive, TSix, TSeven, FormattableString>>, Boolean)
    TableBase<TEntity>.QuerySingle<TOne, Two, TThree, TFour, TFive, TSix, TSeven, TEight>(Expression<Func<TEntity, TOne, Two, TThree, TFour, TFive, TSix, TSeven, TEight, FormattableString>>, Boolean)
    TableBase<TEntity>.QuerySingle(String, NpgsqlParameter[])
    TableBase<TEntity>.QuerySingle(String, IList<NpgsqlParameter>)
    TableBase<TEntity>.QuerySingle(String, Boolean, NpgsqlParameter[])
    TableBase<TEntity>.QueryInterpolatedSingle(FormattableString, Boolean)
    TableBase<TEntity>.QueryInterpolatedSingle(FormattableSqlStringBuilder, Boolean)
    TableBase<TEntity>.QueryBatch(String, Boolean)
    TableBase<TEntity>.QueryBatch(Expression<Func<TEntity, FormattableString>>, Boolean)
    TableBase<TEntity>.QueryBatch<TOne>(Expression<Func<TEntity, TOne, FormattableString>>, Boolean)
    TableBase<TEntity>.QueryBatch<TOne, Two>(Expression<Func<TEntity, TOne, Two, FormattableString>>, Boolean)
    TableBase<TEntity>.QueryBatch<TOne, Two, TThree>(Expression<Func<TEntity, TOne, Two, TThree, FormattableString>>, Boolean)
    TableBase<TEntity>.QueryBatch<TOne, Two, TThree, TFour>(Expression<Func<TEntity, TOne, Two, TThree, TFour, FormattableString>>, Boolean)
    TableBase<TEntity>.QueryBatch<TOne, Two, TThree, TFour, TFive>(Expression<Func<TEntity, TOne, Two, TThree, TFour, TFive, FormattableString>>, Boolean)
    TableBase<TEntity>.QueryBatch<TOne, Two, TThree, TFour, TFive, TSix>(Expression<Func<TEntity, TOne, Two, TThree, TFour, TFive, TSix, FormattableString>>, Boolean)
    TableBase<TEntity>.QueryBatch<TOne, Two, TThree, TFour, TFive, TSix, TSeven>(Expression<Func<TEntity, TOne, Two, TThree, TFour, TFive, TSix, TSeven, FormattableString>>, Boolean)
    TableBase<TEntity>.QueryBatch<TOne, Two, TThree, TFour, TFive, TSix, TSeven, TEight>(Expression<Func<TEntity, TOne, Two, TThree, TFour, TFive, TSix, TSeven, TEight, FormattableString>>, Boolean)
    TableBase<TEntity>.QueryBatch(String, NpgsqlParameter[])
    TableBase<TEntity>.QueryBatch(String, IList<NpgsqlParameter>)
    TableBase<TEntity>.QueryBatch(String, Boolean, NpgsqlParameter[])
    TableBase<TEntity>.QueryInterpolatedBatch(FormattableString, Boolean)
    TableBase<TEntity>.QueryInterpolatedBatch(FormattableSqlStringBuilder, Boolean)
    Namespace: Venflow
    Assembly: Venflow.dll
    Syntax
    public sealed class Table<TEntity> : TableBase<TEntity>, ITable where TEntity : class, new()
    Type Parameters
    Name Description
    TEntity

    The entity which represents a table in the Database.

    Methods

    | Improve this Doc View Source

    CountAsync(CancellationToken)

    Asynchronously counts the total rows the current table.

    Declaration
    public Task<long> CountAsync(CancellationToken cancellationToken = null)
    Parameters
    Type Name Description
    CancellationToken cancellationToken

    The cancellation token, which is used to cancel the operation.

    Returns
    Type Description
    Task<Int64>

    A task representing the asynchronous operation, with the number of rows.

    Remarks

    This method represents the following SQL statement "SELECT COUNT(*) FROM table".

    | Improve this Doc View Source

    Delete()

    Creates a new delete command.

    Declaration
    public IDeleteCommandBuilder<TEntity> Delete()
    Returns
    Type Description
    IDeleteCommandBuilder<TEntity>

    A Fluent API Builder for a delete command.

    Remarks

    The command will be automatically disposed the underlying after the command got executed once.

    | Improve this Doc View Source

    Delete(Boolean)

    Creates a new delete command.

    Declaration
    public IDeleteCommandBuilder<TEntity> Delete(bool disposeCommand)
    Parameters
    Type Name Description
    Boolean disposeCommand

    Indicates whether or not to dispose the underlying after the command got executed once.

    Returns
    Type Description
    IDeleteCommandBuilder<TEntity>

    A Fluent API Builder for a delete command.

    | Improve this Doc View Source

    DeleteAsync(TEntity, CancellationToken)

    Asynchronously deletes the provided entity by its defined primary key.

    Declaration
    public ValueTask<int> DeleteAsync(TEntity entity, CancellationToken cancellationToken = null)
    Parameters
    Type Name Description
    TEntity entity

    A TEntity instance representing the row, which will be deleted.

    CancellationToken cancellationToken

    The cancellation token, which is used to cancel the operation.

    Returns
    Type Description
    ValueTask<Int32>

    A task representing the asynchronous operation, with the number of rows deleted.

    Remarks

    This method represents the following SQL statement "DELETE FROM table WHERE pk = 0". This API is using parameterized commands.

    | Improve this Doc View Source

    DeleteAsync(TEntity[], CancellationToken)

    Asynchronously deletes the provided entities by their defined primary keys.

    Declaration
    public ValueTask<int> DeleteAsync(TEntity[] entities, CancellationToken cancellationToken = null)
    Parameters
    Type Name Description
    TEntity[] entities

    A set of TEntity instances representing the rows, which will be deleted.

    CancellationToken cancellationToken

    The cancellation token, which is used to cancel the operation.

    Returns
    Type Description
    ValueTask<Int32>

    A task representing the asynchronous operation, with the number of rows deleted.

    Remarks

    This method represents the following SQL statement "DELETE FROM table WHERE pk = 0". This API is using parameterized commands.

    | Improve this Doc View Source

    DeleteAsync(IEnumerable<TEntity>, CancellationToken)

    Asynchronously deletes the provided entities by their defined primary keys.

    Declaration
    public ValueTask<int> DeleteAsync(IEnumerable<TEntity> entities, CancellationToken cancellationToken = null)
    Parameters
    Type Name Description
    IEnumerable<TEntity> entities

    A set of TEntity instances representing the rows, which will be deleted.

    CancellationToken cancellationToken

    The cancellation token, which is used to cancel the operation.

    Returns
    Type Description
    ValueTask<Int32>

    A task representing the asynchronous operation, with the number of rows deleted.

    Remarks

    This method represents the following SQL statement "DELETE FROM table WHERE pk = 0". This API is using parameterized commands.

    | Improve this Doc View Source

    DeleteAsync(IList<TEntity>, CancellationToken)

    Asynchronously deletes the provided entities by their defined primary keys.

    Declaration
    public ValueTask<int> DeleteAsync(IList<TEntity> entities, CancellationToken cancellationToken = null)
    Parameters
    Type Name Description
    IList<TEntity> entities

    A set of TEntity instances representing the rows, which will be deleted.

    CancellationToken cancellationToken

    The cancellation token, which is used to cancel the operation.

    Returns
    Type Description
    ValueTask<Int32>

    A task representing the asynchronous operation, with the number of rows deleted.

    Remarks

    This method represents the following SQL statement "DELETE FROM table WHERE pk = 0". This API is using parameterized commands.

    | Improve this Doc View Source

    DeleteAsync(List<TEntity>, CancellationToken)

    Asynchronously deletes the provided entities by their defined primary keys.

    Declaration
    public ValueTask<int> DeleteAsync(List<TEntity> entities, CancellationToken cancellationToken = null)
    Parameters
    Type Name Description
    List<TEntity> entities

    A set of TEntity instances representing the rows, which will be deleted.

    CancellationToken cancellationToken

    The cancellation token, which is used to cancel the operation.

    Returns
    Type Description
    ValueTask<Int32>

    A task representing the asynchronous operation, with the number of rows deleted.

    Remarks

    This method represents the following SQL statement "DELETE FROM table WHERE pk = 0". This API is using parameterized commands.

    | Improve this Doc View Source

    DeleteAsync(IDeleteCommand<TEntity>, TEntity, CancellationToken)

    Asynchronously deletes the provided entity by its defined primary key.

    Declaration
    public ValueTask<int> DeleteAsync(IDeleteCommand<TEntity> deleteCommand, TEntity entity, CancellationToken cancellationToken = null)
    Parameters
    Type Name Description
    IDeleteCommand<TEntity> deleteCommand

    A IDeleteCommand<TEntity> instance which contains all the settings for this operation.

    TEntity entity

    A TEntity instance representing the row, which will be deleted.

    CancellationToken cancellationToken

    The cancellation token, which is used to cancel the operation.

    Returns
    Type Description
    ValueTask<Int32>

    A task representing the asynchronous operation, with the number of rows deleted.

    Remarks

    This method represents the following SQL statement "DELETE FROM table WHERE pk = 0". This API is using parameterized commands.

    | Improve this Doc View Source

    DeleteAsync(IDeleteCommand<TEntity>, IEnumerable<TEntity>, CancellationToken)

    Asynchronously deletes the provided entities by their defined primary keys.

    Declaration
    public ValueTask<int> DeleteAsync(IDeleteCommand<TEntity> deleteCommand, IEnumerable<TEntity> entities, CancellationToken cancellationToken = null)
    Parameters
    Type Name Description
    IDeleteCommand<TEntity> deleteCommand

    A IDeleteCommand<TEntity> instance which contains all the settings for this operation.

    IEnumerable<TEntity> entities

    A set of TEntity instances representing the rows, which will be deleted.

    CancellationToken cancellationToken

    The cancellation token, which is used to cancel the operation.

    Returns
    Type Description
    ValueTask<Int32>

    A task representing the asynchronous operation, with the number of rows deleted.

    Remarks

    This method represents the following SQL statement "DELETE FROM table WHERE pk = 0". This API is using parameterized commands.

    | Improve this Doc View Source

    GetProxiedEntity()

    Constructs a new proxied instance of the TEntity entity.

    Declaration
    public TEntity GetProxiedEntity()
    Returns
    Type Description
    TEntity

    A TEntity instance which will be change tracked.

    Remarks

    Any property which should be change tracked on an entity has to be marked virtual.

    | Improve this Doc View Source

    Insert()

    Creates a new insert command.

    Declaration
    public IBaseInsertRelationBuilder<TEntity, TEntity> Insert()
    Returns
    Type Description
    IBaseInsertRelationBuilder<TEntity, TEntity>

    A Fluent API Builder for a insert command.

    Remarks

    The command will be automatically disposed the underlying after the command got executed once.

    | Improve this Doc View Source

    InsertAsync(TEntity, CancellationToken)

    Asynchronously inserts the entity and all entities reachable from the current provided instance into the current table.

    Declaration
    public Task<int> InsertAsync(TEntity entity, CancellationToken cancellationToken = null)
    Parameters
    Type Name Description
    TEntity entity

    A TEntity instance representing the row, which will be inserted.

    CancellationToken cancellationToken

    The cancellation token, which is used to cancel the operation.

    Returns
    Type Description
    Task<Int32>

    A task representing the asynchronous operation, with the number of rows inserted.

    Remarks

    This method represents the following SQL statement "INSERT INTO table (foo, bar) VALUES ('foo', 'bar')". This API is using parameterized commands.

    | Improve this Doc View Source

    InsertAsync(IList<TEntity>, CancellationToken)

    Asynchronously inserts a list of entities and all entities reachable from the current provided instances into the current table.

    Declaration
    public Task<int> InsertAsync(IList<TEntity> entities, CancellationToken cancellationToken = null)
    Parameters
    Type Name Description
    IList<TEntity> entities

    A list of TEntity instance representing the rows, which will be inserted.

    CancellationToken cancellationToken

    The cancellation token, which is used to cancel the operation.

    Returns
    Type Description
    Task<Int32>

    A task representing the asynchronous operation, with the number of rows inserted.

    Remarks

    This method represents the following SQL statement "INSERT INTO table (foo, bar) VALUES ('foo', 'bar'), ('foo', 'bar')". This API is using parameterized commands.

    | Improve this Doc View Source

    InsertAsync(IInsertCommand<TEntity>, TEntity, CancellationToken)

    Asynchronously inserts the entity and all entities reachable from the current provided instance into the current table.

    Declaration
    public Task<int> InsertAsync(IInsertCommand<TEntity> insertCommand, TEntity entity, CancellationToken cancellationToken = null)
    Parameters
    Type Name Description
    IInsertCommand<TEntity> insertCommand

    A IInsertCommand<TEntity> instance which contains all the settings for this operation.

    TEntity entity

    A TEntity instance representing the row, which will be inserted.

    CancellationToken cancellationToken

    The cancellation token, which is used to cancel the operation.

    Returns
    Type Description
    Task<Int32>

    A task representing the asynchronous operation, with the number of rows inserted.

    Remarks

    This method represents the following SQL statement "INSERT INTO table (foo, bar) VALUES ('foo', 'bar')". This API is using parameterized commands.

    | Improve this Doc View Source

    InsertAsync(IInsertCommand<TEntity>, List<TEntity>, CancellationToken)

    Asynchronously inserts a list of entities and all entities reachable from the current provided instances into the current table.

    Declaration
    public Task<int> InsertAsync(IInsertCommand<TEntity> insertCommand, List<TEntity> entities, CancellationToken cancellationToken = null)
    Parameters
    Type Name Description
    IInsertCommand<TEntity> insertCommand

    A IInsertCommand<TEntity> instance which contains all the settings for this operation.

    List<TEntity> entities

    A list of TEntity instance representing the rows, which will be inserted.

    CancellationToken cancellationToken

    The cancellation token, which is used to cancel the operation.

    Returns
    Type Description
    Task<Int32>

    A task representing the asynchronous operation, with the number of rows inserted.

    Remarks

    This method represents the following SQL statement "INSERT INTO table (foo, bar) VALUES ('foo', 'bar'), ('foo', 'bar')". This API is using parameterized commands.

    | Improve this Doc View Source

    TrackChanges(ref TEntity)

    Starts tracking the provided TEntity.

    Declaration
    public void TrackChanges(ref TEntity entity)
    Parameters
    Type Name Description
    TEntity entity

    A TEntity instance which will be change tracked.

    Remarks

    Any property which should be change tracked on an entity has to be marked virtual.

    | Improve this Doc View Source

    TrackChanges(IList<TEntity>)

    Starts tracking the provided TEntity's.

    Declaration
    public void TrackChanges(IList<TEntity> entities)
    Parameters
    Type Name Description
    IList<TEntity> entities

    A set of TEntity instances which will be change tracked.

    Remarks

    This method represents the following SQL statement "UPDATE table SET foo = 'foo' WHERE pk = 0". This API is using parameterized commands.

    | Improve this Doc View Source

    TruncateAsync(ForeignTruncateOptions, CancellationToken)

    Asynchronously truncates the current table with the provided options.

    Declaration
    public Task TruncateAsync(ForeignTruncateOptions foreignOptions, CancellationToken cancellationToken = null)
    Parameters
    Type Name Description
    ForeignTruncateOptions foreignOptions

    Specifies how the truncate operation should handle foreign tables.

    CancellationToken cancellationToken

    The cancellation token, which is used to cancel the operation.

    Returns
    Type Description
    Task

    A task representing the asynchronous operation.

    Remarks

    This method represents the following SQL statement "TRUNCATE table [CASCADE|RESTRICT|NONE]".

    | Improve this Doc View Source

    TruncateAsync(IdentityTruncateOptions, ForeignTruncateOptions, CancellationToken)

    Asynchronously truncates the current table with the provided options.

    Declaration
    public Task TruncateAsync(IdentityTruncateOptions truncateOptions = default(IdentityTruncateOptions), ForeignTruncateOptions foreignOptions = default(ForeignTruncateOptions), CancellationToken cancellationToken = null)
    Parameters
    Type Name Description
    IdentityTruncateOptions truncateOptions

    Specifies how the truncate operation should handle identities in the table.

    ForeignTruncateOptions foreignOptions

    Specifies how the truncate operation should handle foreign tables.

    CancellationToken cancellationToken

    The cancellation token, which is used to cancel the operation.

    Returns
    Type Description
    Task

    A task representing the asynchronous operation.

    Remarks

    This method represents the following SQL statement "TRUNCATE table [RESTART IDENTITY|CONTINUE IDENTITY|NONE] [CASCADE|RESTRICT|NONE]".

    | Improve this Doc View Source

    Update()

    Creates a new update command.

    Declaration
    public IUpdateCommandBuilder<TEntity> Update()
    Returns
    Type Description
    IUpdateCommandBuilder<TEntity>

    A Fluent API Builder for a update command.

    | Improve this Doc View Source

    Update(Boolean)

    Creates a new update command.

    Declaration
    public IUpdateCommandBuilder<TEntity> Update(bool disposeCommand)
    Parameters
    Type Name Description
    Boolean disposeCommand

    Indicates whether or not to dispose the underlying after the command got executed once.

    Returns
    Type Description
    IUpdateCommandBuilder<TEntity>

    A Fluent API Builder for a update command.

    | Improve this Doc View Source

    UpdateAsync(TEntity, CancellationToken)

    Asynchronously updates the provided entity by its defined primary keys.

    Declaration
    public ValueTask UpdateAsync(TEntity entity, CancellationToken cancellationToken = null)
    Parameters
    Type Name Description
    TEntity entity

    A TEntity instance representing the row, which will be updated.

    CancellationToken cancellationToken

    The cancellation token, which is used to cancel the operation.

    Returns
    Type Description
    ValueTask

    A task representing the asynchronous operation.

    Remarks

    This method represents the following SQL statement "UPDATE table SET foo = 'foo' WHERE pk = 0". This API is using parameterized commands.

    | Improve this Doc View Source

    UpdateAsync(TEntity[], CancellationToken)

    Asynchronously updates the provided entity by its defined primary keys.

    Declaration
    public ValueTask UpdateAsync(TEntity[] entities, CancellationToken cancellationToken = null)
    Parameters
    Type Name Description
    TEntity[] entities

    A set of TEntity instances representing the rows, which will be updated.

    CancellationToken cancellationToken

    The cancellation token, which is used to cancel the operation.

    Returns
    Type Description
    ValueTask

    A task representing the asynchronous operation.

    Remarks

    This method represents the following SQL statement "UPDATE table SET foo = 'foo' WHERE pk = 0". This API is using parameterized commands.

    | Improve this Doc View Source

    UpdateAsync(IEnumerable<TEntity>, CancellationToken)

    Asynchronously updates the provided entity by its defined primary keys.

    Declaration
    public ValueTask UpdateAsync(IEnumerable<TEntity> entities, CancellationToken cancellationToken = null)
    Parameters
    Type Name Description
    IEnumerable<TEntity> entities

    A set of TEntity instances representing the rows, which will be updated.

    CancellationToken cancellationToken

    The cancellation token, which is used to cancel the operation.

    Returns
    Type Description
    ValueTask

    A task representing the asynchronous operation.

    Remarks

    This method represents the following SQL statement "UPDATE table SET foo = 'foo' WHERE pk = 0". This API is using parameterized commands.

    | Improve this Doc View Source

    UpdateAsync(IList<TEntity>, CancellationToken)

    Asynchronously updates the provided entity by its defined primary keys.

    Declaration
    public ValueTask UpdateAsync(IList<TEntity> entities, CancellationToken cancellationToken = null)
    Parameters
    Type Name Description
    IList<TEntity> entities

    A set of TEntity instances representing the rows, which will be updated.

    CancellationToken cancellationToken

    The cancellation token, which is used to cancel the operation.

    Returns
    Type Description
    ValueTask

    A task representing the asynchronous operation.

    Remarks

    This method represents the following SQL statement "UPDATE table SET foo = 'foo' WHERE pk = 0". This API is using parameterized commands.

    | Improve this Doc View Source

    UpdateAsync(List<TEntity>, CancellationToken)

    Asynchronously updates the provided entity by its defined primary keys.

    Declaration
    public ValueTask UpdateAsync(List<TEntity> entities, CancellationToken cancellationToken = null)
    Parameters
    Type Name Description
    List<TEntity> entities

    A set of TEntity instances representing the rows, which will be updated.

    CancellationToken cancellationToken

    The cancellation token, which is used to cancel the operation.

    Returns
    Type Description
    ValueTask

    A task representing the asynchronous operation.

    Remarks

    This method represents the following SQL statement "UPDATE table SET foo = 'foo' WHERE pk = 0". This API is using parameterized commands.

    | Improve this Doc View Source

    UpdateAsync(IUpdateCommand<TEntity>, TEntity, CancellationToken)

    Asynchronously updates the provided entity by its defined primary keys.

    Declaration
    public ValueTask UpdateAsync(IUpdateCommand<TEntity> updateCommand, TEntity entity, CancellationToken cancellationToken = null)
    Parameters
    Type Name Description
    IUpdateCommand<TEntity> updateCommand

    A IUpdateCommand<TEntity> instance which contains all the settings for this operation.

    TEntity entity

    A TEntity instance representing the row, which will be updated.

    CancellationToken cancellationToken

    The cancellation token, which is used to cancel the operation.

    Returns
    Type Description
    ValueTask

    A task representing the asynchronous operation.

    Remarks

    This method represents the following SQL statement "UPDATE table SET foo = 'foo' WHERE pk = 0". This API is using parameterized commands.

    | Improve this Doc View Source

    UpdateAsync(IUpdateCommand<TEntity>, IEnumerable<TEntity>, CancellationToken)

    Asynchronously updates the provided entity by its defined primary keys.

    Declaration
    public ValueTask UpdateAsync(IUpdateCommand<TEntity> updateCommand, IEnumerable<TEntity> entities, CancellationToken cancellationToken = null)
    Parameters
    Type Name Description
    IUpdateCommand<TEntity> updateCommand

    A IUpdateCommand<TEntity> instance which contains all the settings for this operation.

    IEnumerable<TEntity> entities

    A set of TEntity instances representing the rows, which will be updated.

    CancellationToken cancellationToken

    The cancellation token, which is used to cancel the operation.

    Returns
    Type Description
    ValueTask

    A task representing the asynchronous operation.

    Remarks

    This method represents the following SQL statement "UPDATE table SET foo = 'foo' WHERE pk = 0". This API is using parameterized commands.

    Theme

    • Improve this Doc
    • View Source
    Back to top Copyright © 2021 Twenty