using SoftwareInstallationDatabaseImplement.Models;
using Microsoft.EntityFrameworkCore;

namespace SoftwareInstallationDatabaseImplement
{
    public class SoftwareInstallationDatabase : DbContext
    {
        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            // Перед работой необходимо установить SQL Express
            if (optionsBuilder.IsConfigured == false)
            {
                optionsBuilder.UseSqlServer(@"
                Server = localhost\SQLEXPRESS;
                Initial Catalog = SoftwareHard7InstallationDatabaseFull;
                Integrated Security = True;
                MultipleActiveResultSets = True;
                TrustServerCertificate = True");
            }
            base.OnConfiguring(optionsBuilder);
        }
        public virtual DbSet<Component> Components { set; get; }
        public virtual DbSet<Package> Packages { set; get; }
        public virtual DbSet<PackageComponent> PackageComponents { set; get; }
        public virtual DbSet<Order> Orders { set; get; }
        public virtual DbSet<Shop> Shops { set; get; }
        public virtual DbSet<ShopPackage> ShopPackages { set; get; }
        public virtual DbSet<Client> Clients { set; get; }
		public virtual DbSet<Implementer> Implementers { set; get; }
		public virtual DbSet<MessageInfo> Messages { set; get; }
	}
}
