mirror of
https://onedev.fprog.nl/DiscordClient
synced 2026-03-03 11:24:09 +01:00
Basic DbContext setup.
This commit is contained in:
parent
4460e1eb72
commit
aa4112b733
22
DiscordDelete/DiscordContext.cs
Normal file
22
DiscordDelete/DiscordContext.cs
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
|
namespace DiscordDelete
|
||||||
|
{
|
||||||
|
public class DiscordContext : DbContext
|
||||||
|
{
|
||||||
|
private const string DataPath = "messages.db";
|
||||||
|
public DbSet<GuildMessage> GuildMessages { get; set; }
|
||||||
|
public DbSet<PrivateMessage> PrivateMessages { get; set; }
|
||||||
|
|
||||||
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) =>
|
||||||
|
optionsBuilder.UseSqlite($"Data Source={DataPath}");
|
||||||
|
}
|
||||||
|
|
||||||
|
public class GuildMessage { }
|
||||||
|
|
||||||
|
public class PrivateMessage { }
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue