# Class EchoHubDbContext | EchoHub Documentation

# Class EchoHubDbContext

Namespace
  EchoHub.Server.Data

Assembly
  EchoHub.Server.dll

    public class EchoHubDbContext : DbContext, IDisposable, IAsyncDisposable

Inheritance
  object
  DbContext
  EchoHubDbContext

Implements
  IDisposable
  IAsyncDisposable

Inherited Members
  object.GetType()
  object.MemberwiseClone()
  object.ToString()
  object.Equals(object)
  object.Equals(object, object)
  object.ReferenceEquals(object, object)
  object.GetHashCode()

## Constructors

### EchoHubDbContext(DbContextOptions<EchoHubDbContext>)

    public EchoHubDbContext(DbContextOptions<EchoHubDbContext> options)

#### Parameters

`options` DbContextOptions<EchoHubDbContext>

## Properties

### Attachments

    public DbSet<Attachment> Attachments { get; }

#### Property Value

DbSet<Attachment>

### ChannelMemberships

    public DbSet<ChannelMembership> ChannelMemberships { get; }

#### Property Value

DbSet<ChannelMembership>

### Channels

    public DbSet<Channel> Channels { get; }

#### Property Value

DbSet<Channel>

### InviteCodes

    public DbSet<InviteCode> InviteCodes { get; }

#### Property Value

DbSet<InviteCode>

### Messages

    public DbSet<Message> Messages { get; }

#### Property Value

DbSet<Message>

### RefreshTokens

    public DbSet<RefreshToken> RefreshTokens { get; }

#### Property Value

DbSet<RefreshToken>

### ServerStatsReports

    public DbSet<ServerStatsReport> ServerStatsReports { get; }

#### Property Value

DbSet<ServerStatsReport>

### Users

    public DbSet<User> Users { get; }

#### Property Value

DbSet<User>

## Methods

### OnConfiguring(DbContextOptionsBuilder)

    protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)

#### Parameters

`optionsBuilder` DbContextOptionsBuilder

### OnModelCreating(ModelBuilder)

    protected override void OnModelCreating(ModelBuilder modelBuilder)

#### Parameters

`modelBuilder` ModelBuilder