using BankDatabaseImplement.Models; using Microsoft.EntityFrameworkCore; namespace BankDatabaseImplement { public class BankDatabase : DbContext { protected override void OnConfiguring( DbContextOptionsBuilder optionsBuilder) { if (optionsBuilder.IsConfigured == false) { optionsBuilder.UseSqlServer(@"Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=BankDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True"); } base.OnConfiguring(optionsBuilder); } protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity() .HasKey(c => c.Snils); } public virtual DbSet Clients { set; get; } public virtual DbSet ClientPrograms { set; get; } public virtual DbSet ClientDeposits { set; get; } public virtual DbSet Currencies { set; get; } public virtual DbSet Deposits { set; get; } public virtual DbSet DepositCurrencies { set; get; } public virtual DbSet Programs { set; get; } public virtual DbSet ProgramCurrencies { set; get; } public virtual DbSet Refills { set; get; } public virtual DbSet Terms { set; get; } public virtual DbSet Workers { set; get; } } }