Show / Hide Table of Contents

    Interface IDbSet<TEntity>

    Abstracts the DbSet functionality to allow for multiple and decoupled implementations.

    Namespace: Silverback.Database
    Assembly: Silverback.Core.dll
    Syntax
    public interface IDbSet<TEntity> where TEntity : class
    Type Parameters
    Name Description
    TEntity

    The type of the entity being stored in this set.

    Methods

    | Improve this doc View source

    Add(TEntity)

    Adds the specified entity to the set and start tracking it. The entity will be inserted into the database when saving changes.

    Declaration
    TEntity Add(TEntity entity)
    Parameters
    Type Name Description
    TEntity entity

    The entity to be added.

    Returns
    Type Description
    TEntity

    The added entity.

    | Improve this doc View source

    AsQueryable()

    Returns an IQueryable to query the set.

    Declaration
    IQueryable<TEntity> AsQueryable()
    Returns
    Type Description
    IQueryable<TEntity>

    An IQueryable<T>.

    | Improve this doc View source

    Find(params object[])

    Finds the entity with the specified key(s). Returns null if not found.

    Declaration
    TEntity? Find(params object[] keyValues)
    Parameters
    Type Name Description
    object[] keyValues

    The entity keys.

    Returns
    Type Description
    TEntity

    The entity found, or null.

    | Improve this doc View source

    FindAsync(params object[])

    Finds the entity with the specified key(s). Returns null if not found.

    Declaration
    Task<TEntity?> FindAsync(params object[] keyValues)
    Parameters
    Type Name Description
    object[] keyValues

    The entity keys.

    Returns
    Type Description
    Task<TEntity>

    The entity found, or null.

    | Improve this doc View source

    GetLocalCache()

    Returns the locally cached entities.

    Declaration
    IEnumerable<TEntity> GetLocalCache()
    Returns
    Type Description
    IEnumerable<TEntity>

    The entities in the local cache.

    | Improve this doc View source

    Remove(TEntity)

    Removes the specified entity from the set causing it to be deleted when saving changes.

    Declaration
    TEntity Remove(TEntity entity)
    Parameters
    Type Name Description
    TEntity entity

    The entity to be removed.

    Returns
    Type Description
    TEntity

    The removed entity.

    | Improve this doc View source

    RemoveRange(IEnumerable<TEntity>)

    Removes the specified entities from the set causing them to be deleted when saving changes.

    Declaration
    void RemoveRange(IEnumerable<TEntity> entities)
    Parameters
    Type Name Description
    IEnumerable<TEntity> entities

    The entities to be removed.

    • Improve this doc
    • View source
    GitHub E-Mail
    ↑ Back to top © 2020 Sergio Aquilini