﻿using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using QnAMaker.Model;

namespace QnAMaker
{
    public class KbContext : DbContext
    {
        private IConfigurationRoot _configuration;

        public DbSet<KbResult> Kbs { get; set; }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            _configuration = new ConfigurationBuilder().AddJsonFile("dbsettings.json", false, true).Build();
            optionsBuilder.UseSqlite(_configuration.GetConnectionString("Kb"));
        }
    }
}
