43 lines
1.4 KiB
C#
43 lines
1.4 KiB
C#
using HospitalDatabaseImplement.Models;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace HospitalDatabaseImplement
|
|
{
|
|
public class HospitalDatabase : DbContext
|
|
{
|
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|
{
|
|
if (optionsBuilder.IsConfigured == false)
|
|
{
|
|
optionsBuilder.UseSqlServer(@"Data Source=localhost\SQLEXPRESS;Initial Catalog=HospitalDatabaseFull;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
|
|
}
|
|
base.OnConfiguring(optionsBuilder);
|
|
}
|
|
public virtual DbSet<Doctor> Doctors { set; get; }
|
|
|
|
public virtual DbSet<Patient> Patients { set; get; }
|
|
|
|
public virtual DbSet<Recipe> Recipes { set; get; }
|
|
|
|
public virtual DbSet<Disease> Diseases { set; get; }
|
|
|
|
public virtual DbSet<Medicine> Medicines { set; get; }
|
|
|
|
public virtual DbSet<Procedure> Procedures { set; get; }
|
|
|
|
public virtual DbSet<PatientRecipe> PatientRecipes { set; get; }
|
|
|
|
public virtual DbSet<PatientProcedure> PatientProcedures { set; get; }
|
|
|
|
public virtual DbSet<RecipeMedicine> RecipeMedicines { set; get; }
|
|
|
|
public virtual DbSet<ProcedureMedicine> ProcedureMedicines { set; get; }
|
|
}
|
|
}
|