Show / Hide Table of Contents

    Class EfCoreDbContext<TDbContext>

    An implementation of IDbContext that works with Entity Framework Core.

    Inheritance
    object
    EfCoreDbContext<TDbContext>
    Implements
    IDbContext
    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 EfCoreDbContext<TDbContext> : IDbContext where TDbContext : DbContext
    Type Parameters
    Name Description
    TDbContext

    The type of the underlying DbContext.

    Constructors

    | Improve this doc View source

    EfCoreDbContext(TDbContext)

    Initializes a new instance of the EfCoreDbContext<TDbContext> class.

    Declaration
    public EfCoreDbContext(TDbContext dbContext)
    Parameters
    Type Name Description
    TDbContext dbContext

    The wrapped DbContext.

    Methods

    | Improve this doc View source

    GetDbSet<TEntity>()

    Returns an IDbSet<TEntity> for the specified entity type.

    Declaration
    public IDbSet<TEntity> GetDbSet<TEntity>() where TEntity : class
    Returns
    Type Description
    IDbSet<TEntity>

    An IDbSet<TEntity>.

    Type Parameters
    Name Description
    TEntity

    The type of the entity.

    | Improve this doc View source

    SaveChanges()

    Saves all changes made in this context to the database.

    Declaration
    public void SaveChanges()
    | Improve this doc View source

    SaveChangesAsync()

    Saves all changes made in this context to the database.

    Declaration
    public Task SaveChangesAsync()
    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    Implements

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