PIbd-22_Bazunov_AI_Hotel/Hotel/HotelDatabaseImplement/HotelDataBase.cs

24 lines
1.0 KiB
C#
Raw Normal View History

2023-04-07 13:15:55 +04:00
using HotelDatabaseImplement.Models;
using Microsoft.EntityFrameworkCore;
namespace HotelDatabaseImplement;
public class HotelDataBase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseSqlServer(@"Data Source=LAPTOP-QKSH4DCA\SQLEXPRESS;Initial Catalog=Hotel;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Room> Rooms { get; set; }
public virtual DbSet<Reservation> Reservations { get; set; }
public virtual DbSet<ReservationRoom> ReservationRooms { get; set; }
public virtual DbSet<Maitre> Maitres { get; set; }
public virtual DbSet<Guest> Guests { get; set; }
public virtual DbSet<Cleaning> Cleanings { get; set; }
public virtual DbSet<CleaningInstruments> CleaningInstruments { get; set; }
public virtual DbSet<CleaningInstrument> CleaningInstrument { get; set; }
}