CourseWork_Hotel/Hotel/HotelDataBaseImplement/HotelDataBase.cs

30 lines
1.4 KiB
C#
Raw Normal View History

using HotelDataBaseImplement.Models;
using Microsoft.EntityFrameworkCore;
2023-04-01 20:12:06 +04:00
namespace HotelDataBaseImplement
{
public class HotelDataBase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseSqlServer(@"Data Source=DESKTOP-V0ON61E\SQLEXPRESS;Initial Catalog=HotelDataBaseFull;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Conference> Conferences { set; get; }
public virtual DbSet<Room> Rooms { set; get; }
public virtual DbSet<MealPlan> MealPlans { set; get; }
public virtual DbSet<ConferenceBooking> ConferenceBookings { set; get; }
public virtual DbSet<Member> Members { set; get; }
public virtual DbSet<Dinner> Dinners { set; get; }
public virtual DbSet<Organiser> Organisers { set; get; }
public virtual DbSet<Headwaiter> Headwaiters { set; get; }
public virtual DbSet<ConferenceMember> ConferenceMembers { set; get; }
public virtual DbSet<RoomDinner> RoomDinners { set; get; }
public virtual DbSet<MealPlanMember> MealPlanMembers { set; get; }
public virtual DbSet<ConferenceBookingDinner> ConferenceBookingDinners { set; get; }
2023-04-01 20:12:06 +04:00
}
}