-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSQLiteContext.cs
23 lines (19 loc) · 931 Bytes
/
SQLiteContext.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
namespace Kanawanagasaki.TwitchHub;
using Kanawanagasaki.TwitchHub.Models;
using Microsoft.Data.Sqlite;
using Microsoft.EntityFrameworkCore;
public class SQLiteContext : DbContext
{
public required DbSet<TwitchAuthModel> TwitchAuth { get; set; }
public required DbSet<TwitchCustomRewardModel> TwitchCustomRewards { get; set; }
public required DbSet<TextCommandModel> TextCommands { get; set; }
public required DbSet<JsAfkCodeModel> JsAfkCodes { get; set; }
public required DbSet<ViewerVoice> ViewerVoices { get; set; }
public required DbSet<SettingModel> Settings { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
var connectionStringBuilder = new SqliteConnectionStringBuilder { DataSource = "data.db" };
var connection = new SqliteConnection(connectionStringBuilder.ToString());
optionsBuilder.UseSqlite(connection);
}
}