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

38 lines
1.2 KiB
C#
Raw 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)
{
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseSqlServer(@"Data Source=.\SQLEXPRESS;Initial Catalog=TravelAgencyDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
}
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<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; }
}
}