Case_accounting/CaseAccounting/CaseAccountingDataBaseImplement/CaseAccountingDatabase.cs

50 lines
1.5 KiB
C#
Raw Normal View History

using CaseAccountingDataBaseImplement.Models;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CaseAccountingDataBaseImplement
{
public class CaseAccountingDatabase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseNpgsql(@"
Host=localhost;
Port=5432;
Database=CaseAccountingDatabase;
2023-05-18 00:37:00 +04:00
Username=courseuser;
Password=courseuser");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Case> Cases { set; get; }
public virtual DbSet<User> Users { set; get; }
public virtual DbSet<Contract> Contracts { set; get; }
public virtual DbSet<Deal> Deals { set; get; }
public virtual DbSet<CaseDeal> CaseDeals { set; get; }
public virtual DbSet<CaseLawyer> CaseLawyers { set; get; }
public virtual DbSet<DealContract> DealContracts { set; get; }
public virtual DbSet<Hearing> Hearings { set; get; }
public virtual DbSet<Lawyer> Lawyers { set; get; }
2023-04-08 22:40:14 +04:00
public virtual DbSet<LawyerContract> LawyerContracts { set; get; }
public virtual DbSet<Specialization> Specializations { get; set; }
}
}