2024-04-28 20:12:32 +04:00
|
|
|
|
using BankDatabaseImplement.Models;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
2024-04-28 18:50:40 +04:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
namespace BankDatabaseImplement
|
|
|
|
|
{
|
2024-04-28 20:12:32 +04:00
|
|
|
|
public class BankDB : DbContext
|
2024-04-28 18:50:40 +04:00
|
|
|
|
{
|
2024-04-28 20:12:32 +04:00
|
|
|
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|
|
|
|
{
|
|
|
|
|
if (optionsBuilder.IsConfigured == false)
|
|
|
|
|
{
|
|
|
|
|
optionsBuilder.UseNpgsql(@"
|
|
|
|
|
Host=localhost;
|
|
|
|
|
Port=5432;
|
|
|
|
|
Database=BankFullNew;
|
|
|
|
|
Username=postgres;
|
|
|
|
|
Password=55256636a;");
|
|
|
|
|
}
|
|
|
|
|
base.OnConfiguring(optionsBuilder);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public virtual DbSet<Client> Clients { set; get; }
|
|
|
|
|
public virtual DbSet<Cost> Costs { set; get; }
|
|
|
|
|
public virtual DbSet<CostByPurchase> CostByPurchases { set; get; }
|
|
|
|
|
public virtual DbSet<Employee> Employees { set; get; }
|
|
|
|
|
public virtual DbSet<Operation> Operations { set; get; }
|
|
|
|
|
public virtual DbSet<OperationByPurchase> OperationByPurchases { set; get; }
|
|
|
|
|
public virtual DbSet<Payment> Payments { set; get; }
|
|
|
|
|
public virtual DbSet<Purchase> Purchases { set; get; }
|
2024-04-28 18:50:40 +04:00
|
|
|
|
}
|
|
|
|
|
}
|