CourseWork_Hotel/Hotel/HotelDataBaseImplement/HotelDataBase.cs

23 lines
1013 B
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=ANNZHIMOL\SQLEXPRESS;Initial Catalog=HotelDataBaseFull;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Conference> Conferences { set; get; }
public virtual DbSet<MealPlan> MealPlans { set; get; }
public virtual DbSet<Member> Members { set; get; }
public virtual DbSet<Organiser> Organisers { set; get; }
public virtual DbSet<ConferenceMember> ConferenceMembers { set; get; }
public virtual DbSet<MealPlanMember> MealPlanMembers { set; get; }
2023-04-01 20:12:06 +04:00
}
}