2024-04-28 23:08:12 +04:00
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
using TravelAgencyDatabaseImplement.Models;
|
|
|
|
|
|
|
|
|
|
namespace TravelAgencyDatabaseImplement
|
|
|
|
|
{
|
|
|
|
|
public class TravelAgencyDatabase : DbContext
|
|
|
|
|
{
|
|
|
|
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|
|
|
|
{
|
2024-05-30 03:40:26 +04:00
|
|
|
|
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
|
2024-04-28 23:08:12 +04:00
|
|
|
|
if (optionsBuilder.IsConfigured == false)
|
|
|
|
|
{
|
2024-05-30 03:40:26 +04:00
|
|
|
|
optionsBuilder.UseNpgsql("Host=localhost;Database=CarRepairShopDBHard;Username=postgres;Password=postgres");
|
2024-04-28 23:08:12 +04:00
|
|
|
|
}
|
|
|
|
|
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; }
|
|
|
|
|
|
2024-05-29 13:06:49 +04:00
|
|
|
|
public virtual DbSet<ExcursionGroupPlace> ExcursionGroupPlaces { set; get; }
|
|
|
|
|
|
2024-04-28 23:08:12 +04:00
|
|
|
|
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; }
|
|
|
|
|
}
|
|
|
|
|
}
|