using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using MS.DbContexts.AccountingService;
using MS.DbContexts.SQLite;
using MS.Entities.AccountingService_Models;
using MS.Entities.SQLite;
using System;
using System.Collections.Generic;
using System.Text;

namespace MS.DbContexts
{
    public class SQLiteContext : DbContext
    {
        public SQLiteContext(DbContextOptions<SQLiteContext> options)
           : base(options)
        {
        }
        public static readonly ILoggerFactory MyLoggerFactory = LoggerFactory.Create(builder => builder.AddDebug().AddConsole());
        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            base.OnConfiguring(optionsBuilder);
            optionsBuilder.UseLoggerFactory(MyLoggerFactory);
        }
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.ApplyConfiguration(new BuidMembershipGroupMap());
            modelBuilder.ApplyConfiguration(new MembershipGroupListMap());
            base.OnModelCreating(modelBuilder);
        }
    }
}
