using LC_Bot.Models;
using Microsoft.EntityFrameworkCore;

namespace LC_Bot;

public partial class Db : DbContext
{
    public virtual DbSet<Cam> Cams { get; set; }
    public virtual DbSet<Error> Errors { get; set; }
    public Db() => Database.EnsureCreated();

    protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
    {
#if DEBUG
        optionsBuilder.UseSqlite("Data Source=Error.db");
#else
        optionsBuilder.UseSqlite(@"Data Source=C:\Users\mastankov\Desktop\ForMonitoring\Soft\LC_Api\Error.db");
#endif

    }

    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        OnModelCreatingPartial(modelBuilder);
    }

    partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
}