Skip to content

Commit 9a34d26

Browse files
forgot to add some files
1 parent b653b99 commit 9a34d26

File tree

4 files changed

+49
-0
lines changed

4 files changed

+49
-0
lines changed

src/Database/DphContext.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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+
}

src/Database/Entity/UserEntity.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
}

0 commit comments

Comments
 (0)