File tree Expand file tree Collapse file tree 4 files changed +49
-0
lines changed
Expand file tree Collapse file tree 4 files changed +49
-0
lines changed Original file line number Diff line number Diff line change 1+ using Microsoft . EntityFrameworkCore ;
2+
3+ public class DphContext : DbContext
4+ {
5+ public DbSet < UserEntity > Users { get ; set ; }
6+ public DbSet < MessageEntity > Messages { get ; set ; }
7+ public DbSet < ThreadEntity > Threads { get ; set ; }
8+
9+ public string DbPath { get ; set ; }
10+
11+ public DphContext ( DbContextOptions < DphContext > options ) : base ( options ) { }
12+ }
Original file line number Diff line number Diff line change 1+ using System ;
2+
3+ public class MessageEntity
4+ {
5+ public int Id { get ; set ; }
6+ public ulong MessageId { get ; set ; }
7+ public ulong ThreadId { get ; set ; }
8+ public DateTime Timestamp { get ; set ; }
9+
10+ public int UserId { get ; set ; }
11+ public UserEntity User { get ; set ; }
12+ }
Original file line number Diff line number Diff line change 1+ using System . Collections . Generic ;
2+
3+ public class ThreadEntity
4+ {
5+ public int Id { get ; set ; }
6+ public ulong DiscordThreadId { get ; set ; }
7+ public string Title { get ; set ; }
8+ public int MessageCount { get ; set ; }
9+
10+ public ICollection < MessageEntity > Messages { get ; set ; }
11+ }
Original file line number Diff line number Diff line change 1+ using System . Collections . Generic ;
2+
3+ public class UserEntity
4+ {
5+ public int Id { get ; set ; }
6+ public ulong DiscordId { get ; set ; }
7+ public string Username { get ; set ; }
8+
9+ public int QuestionsAsked { get ; set ; }
10+ public int AnswersGiven { get ; set ; }
11+ public int ThreadsParticipatedIn { get ; set ; }
12+
13+ public ICollection < MessageEntity > Messages { get ; set ; }
14+ }
You can’t perform that action at this time.
0 commit comments