using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Options; using VeterinaryClinicDatabaseImplement.Models; namespace VeterinaryClinicDatabaseImplement { public class VeterinaryClinicDatabase: DbContext { protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { if (optionsBuilder.IsConfigured == false) { optionsBuilder.UseNpgsql(@"Host=localhost;Port=5432;Database=VeterinaryClinicDatabase;Username=postgres;Password=postgres"); } base.OnConfiguring(optionsBuilder); AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); AppContext.SetSwitch("Npgsql.DisableDateTimeInfinityConversions", true); } public virtual DbSet Animals { set; get; } public virtual DbSet AnimalMedications { set; get; } public virtual DbSet Medications { set; get; } public virtual DbSet Services { set; get; } public virtual DbSet Users { set; get; } public virtual DbSet Vaccinations { set; get; } public virtual DbSet Visits { set; get; } public virtual DbSet VisitAnimals { set; get; } public virtual DbSet VisitServices { set; get; } } }