mirror of
https://onedev.fprog.nl/DiscordClient
synced 2025-12-29 19:48:36 +01:00
29 lines
802 B
C#
29 lines
802 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace DiscordDelete
|
|
{
|
|
public class DiscordContext : DbContext
|
|
{
|
|
private const string DataPath = "messages.db";
|
|
public DbSet<Message> Messages { get; set; }
|
|
|
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) =>
|
|
optionsBuilder.UseSqlite($"Data Source={DataPath}");
|
|
}
|
|
|
|
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; }
|
|
}
|
|
}
|