Show / Hide Table of Contents

    Class EfCoreDbSet<TEntity>

    An implementation of IDbSet<TEntity> that works with Entity Framework Core.

    Inheritance
    object
    EfCoreDbSet<TEntity>
    Implements
    IDbSet<TEntity>
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Silverback.Database
    Assembly: Silverback.Core.EFCore30.dll
    Syntax
    public class EfCoreDbSet<TEntity> : IDbSet<TEntity> where TEntity : class
    Type Parameters
    Name Description
    TEntity

    The type of the entity being stored in this set.

    Constructors

    | Improve this doc View source

    EfCoreDbSet(DbSet<TEntity>)

    Initializes a new instance of the EfCoreDbSet<TEntity> class.

    Declaration
    public EfCoreDbSet(DbSet<TEntity> dbSet)
    Parameters
    Type Name Description
    DbSet<TEntity> dbSet

    The underlying DbSet<TEntity>.

    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
    public 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
    public 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
    public 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
    public 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
    public 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
    public 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
    public void RemoveRange(IEnumerable<TEntity> entities)
    Parameters
    Type Name Description
    IEnumerable<TEntity> entities

    The entities to be removed.

    Implements

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