PIbd-21_Anisin_R.S._CourseW.../TravelAgency/TravelAgencyDatabaseImplement/TravelAgencyDatabase.cs

41 lines
1.3 KiB
C#
Raw Permalink Normal View History

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; }
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; }
}
}