mirror of
https://onedev.fprog.nl/DiscordClient
synced 2025-12-29 23:38:37 +01:00
Defined structure of message.
This commit is contained in:
parent
aa4112b733
commit
a73ac73420
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
|
@ -9,14 +10,19 @@ namespace DiscordDelete
|
|||
public class DiscordContext : DbContext
|
||||
{
|
||||
private const string DataPath = "messages.db";
|
||||
public DbSet<GuildMessage> GuildMessages { get; set; }
|
||||
public DbSet<PrivateMessage> PrivateMessages { get; set; }
|
||||
public DbSet<Message> Messages { get; set; }
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) =>
|
||||
optionsBuilder.UseSqlite($"Data Source={DataPath}");
|
||||
}
|
||||
|
||||
public class GuildMessage { }
|
||||
|
||||
public class PrivateMessage { }
|
||||
public class Message
|
||||
{
|
||||
[Key]
|
||||
public long Id { get; set; }
|
||||
public string? ChannelId { get; set; }
|
||||
public string? MessageId { get; set; }
|
||||
public string? Content { get; set; }
|
||||
public int? LastHttpCode { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue