Case_accounting/CaseAccounting/CaseAccountingDataBaseImplement/CaseAccountingDatabase.cs

52 lines
1.5 KiB
C#

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;
Username=postgres;
Password=postgres");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Case> Cases { set; get; }
public virtual DbSet<User> Users { set; get; }
public virtual DbSet<Role> Roles { 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; }
public virtual DbSet<LawyerContract> LawyerContracts { set; get; }
public virtual DbSet<Specialization> Specializations { get; set; }
}
}