using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WorkFlowCheck.MAUI.DataLayer.Entities;
using Location = WorkFlowCheck.MAUI.DataLayer.Entities.Location;

namespace WorkFlowCheck.MAUI.DataLayer
{
    public class AppDbContext : DbContext
    {
        private string DbPath { get; }

        public DbSet<CheckListHeader> CheckListHeaders { get; set; }
        public DbSet<CheckListRow> CheckListRows { get; set; }
        public DbSet<CheckListTemplateHeader> CheckListTemplateHeaders { get; set; }
        public DbSet<CheckListTemplateRow> CheckListTemplateRows { get; set; }
        public DbSet<CheckPoint> CheckPoints { get; set; }
        public DbSet<Equipment> Equipments { get; set; }
        public DbSet<Location> Locations { get; set; }

        public AppDbContext()
        {
            DbPath = Path.Combine(FileSystem.AppDataDirectory, "wfc.db");

        }
        protected override void OnConfiguring(DbContextOptionsBuilder options)
        {
            options.UseSqlite($"Data Source={DbPath};Foreign Keys=False;");
            options.EnableSensitiveDataLogging();
        }
        
    }
}
