PIbd-21_Anisin_R.S._CourseW.../TravelAgency/TravelAgencyDatabaseImplement/TravelAgencyDatabase.cs
2024-05-30 03:40:26 +04:00

41 lines
1.3 KiB
C#

using Microsoft.EntityFrameworkCore;
using TravelAgencyDatabaseImplement.Models;
namespace TravelAgencyDatabaseImplement
{
public class TravelAgencyDatabase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseNpgsql("Host=localhost;Database=CarRepairShopDBHard;Username=postgres;Password=postgres");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Excursion> Excursions { set; get; }
public virtual DbSet<ExcursionGroup> ExcursionGroups { set; get; }
public virtual DbSet<Tour> Tours { set; get; }
public virtual DbSet<ExcursionTour> ExcursionTours { set; get; }
public virtual DbSet<ExcursionGroupTour> ExcursionGroupTours { set; get; }
public virtual DbSet<ExcursionGroupPlace> ExcursionGroupPlaces { set; get; }
public virtual DbSet<Guide> Guides { set; get; }
public virtual DbSet<Place> Places { set; get; }
public virtual DbSet<User> Users { set; get; }
public virtual DbSet<Trip> Trips { set; get; }
public virtual DbSet<TripPlace> TripPlaces { set; get; }
}
}