24 lines
1.0 KiB
C#
24 lines
1.0 KiB
C#
|
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; }
|
|||
|
}
|