mirror of
https://github.com/Cleanuparr/Cleanuparr.git
synced 2026-02-18 14:54:54 -05:00
23 lines
600 B
C#
23 lines
600 B
C#
using Common.Helpers;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace Data;
|
|
|
|
/// <summary>
|
|
/// Database context for configuration data
|
|
/// </summary>
|
|
public class DataContext : DbContext
|
|
{
|
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|
{
|
|
if (!optionsBuilder.IsConfigured)
|
|
{
|
|
var dbPath = Path.Combine(ConfigurationPathProvider.GetConfigPath(), "cleanuparr.db");
|
|
optionsBuilder.UseSqlite($"Data Source={dbPath}");
|
|
}
|
|
}
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
{
|
|
}
|
|
} |