using AipGateway.Data.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AipGateway.Data
{
    public class AipDbContext : DbContext
    {
        private readonly ILogger<AipDbContext> _logger;

        public AipDbContext(ILogger<AipDbContext> logger, DbContextOptions<AipDbContext> options)
        : base(options)
        {
            _logger = logger;
            _logger.LogError("eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee: AipDbContext");
        }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            //string cn = "Server=.;Database=TestDB;Trusted_Connection=True;MultipleActiveResultSets=true";
            //optionsBuilder.UseSqlServer(cn);
        }

        public DbSet<TbLinkedSystem> LinkedSystems { get; set; }
        public DbSet<TbLinkedServer> LinkedServers { get; set; }
        public DbSet<TbLinkedDecryptKey> LinkedDecryptKeys { get; set; }
        public DbSet<TbLinkedApiKey> LinkedApiKeys { get; set; }

        public DbSet<TbAipLabel> AipLabels { get; set; }
        public DbSet<TbAipPolicy> AipPolicies { get; set; }
        public DbSet<TbAipProtection> AipProtections { get; set; }

        public DbSet<TbAipServer> AipServers { get; set; }
        public DbSet<TbAipConfig> AipConfigs { get; set; }

        public DbSet<TbAipFileJobLog> AipFileJobLogs { get; set; }
        public DbSet<TbAipApiCallLog> AipApiCallLogs { get; set; }

    }
}
