CourseWork_Bank/Bank/BankDatabaseImplement/BankDatabase.cs

35 lines
1.5 KiB
C#

using BankDatabaseImplement.Models;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.Design;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BankDatabaseImplement
{
public class BankDatabase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseSqlServer(@"Data Source=localhost\SQLEXPRESS;Initial Catalog=BankDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Operator> Operators { set; get; }
public virtual DbSet<Deal> Deals { set; get; }
public virtual DbSet<Payment> Payments { set; get; }
public virtual DbSet<Transfer> Transfers { set; get; }
public virtual DbSet<DealPayment> DealPayments { set; get; }
public virtual DbSet<CurrencyPayment> CurrencyPayments { set; get; }
public virtual DbSet<Currency> Currencies { set; get; }
public virtual DbSet<BankOperator> BankOperators { set; get; }
public virtual DbSet<CreditProgram> CreditPrograms { set; get; }
public virtual DbSet<CurrencyPurchase> CurrencyPurchases { set; get; }
public virtual DbSet<CreditProgramCurrency> CreditProgramCurrencies { set; get; }
}
}