mirror of
https://onedev.fprog.nl/DiscordClient
synced 2026-01-26 04:43:42 +01:00
Defined structure of message.
This commit is contained in:
parent
aa4112b733
commit
a73ac73420
|
|
@ -1,5 +1,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
@ -9,14 +10,19 @@ namespace DiscordDelete
|
||||||
public class DiscordContext : DbContext
|
public class DiscordContext : DbContext
|
||||||
{
|
{
|
||||||
private const string DataPath = "messages.db";
|
private const string DataPath = "messages.db";
|
||||||
public DbSet<GuildMessage> GuildMessages { get; set; }
|
public DbSet<Message> Messages { get; set; }
|
||||||
public DbSet<PrivateMessage> PrivateMessages { get; set; }
|
|
||||||
|
|
||||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) =>
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) =>
|
||||||
optionsBuilder.UseSqlite($"Data Source={DataPath}");
|
optionsBuilder.UseSqlite($"Data Source={DataPath}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public class GuildMessage { }
|
public class Message
|
||||||
|
{
|
||||||
public class PrivateMessage { }
|
[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