using System;
using System.Collections.Generic;
using System.Linq;
using System.Security;
using System.Text;
using System.Threading.Tasks;
using AyCode.Database.DbContexts;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Options;

namespace TIAM.Database.DbContexts
{
    public class DbContextBase : AcDbContextBase
    {
        public DbContextBase() //: this(string.Empty)
        {

        }

        public DbContextBase(string name) : base(name)
        {
        }

        public DbContextBase(DbContextOptions<DbContext> options, string name) : base(options, name)
        {
        }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            base.OnConfiguring(optionsBuilder);

            optionsBuilder.UseLazyLoadingProxies(true);
            optionsBuilder.EnableDetailedErrors(true);

            //optionsBuilder.UseSqlServer(Configuration.GetConnectionString("DeveloperDbConnection"));
            var connString = "Data Source=185.51.190.197;Initial Catalog=TIAM_DEV;Trusted_Connection=false;Encrypt=false;TrustServerCertificate=True;Connect Timeout=200;User ID=Anata_Development_Team;Password=v6f_?xNfg9N1;MultipleActiveResultSets=true";
            optionsBuilder.UseSqlServer(connString);
        }
    }
}
