28 lines
1004 B
C#
28 lines
1004 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using HotelDatabaseImplement.Models;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace HotelDatabaseImplement
|
|
{
|
|
public class HotelDatabase : DbContext
|
|
{
|
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|
{
|
|
if (optionsBuilder.IsConfigured == false)
|
|
{
|
|
optionsBuilder.UseSqlServer(@"Data Source=localhost\SQLEXPRESS;Initial Catalog=TestProject;Integrated Security=True;MultipleActiveResultSets=True;TrustServerCertificate=True");
|
|
}
|
|
base.OnConfiguring(optionsBuilder);
|
|
}
|
|
public virtual DbSet<Booking> Bookings { get; set; }
|
|
public virtual DbSet<Client> Clients { get; set; }
|
|
public virtual DbSet<Post> Posts { get; set; }
|
|
public virtual DbSet<Room> Rooms { get; set; }
|
|
public virtual DbSet<Worker> Workers { get; set; }
|
|
}
|
|
}
|