31 lines
1.1 KiB
C#
31 lines
1.1 KiB
C#
|
using Microsoft.EntityFrameworkCore;
|
|||
|
using SushiBarDatabaseImplement.Models;
|
|||
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Data.Common;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using System.Threading.Tasks;
|
|||
|
|
|||
|
namespace SushiBarDatabaseImplement
|
|||
|
{
|
|||
|
public class SushiBarDatabase : DbContext
|
|||
|
{
|
|||
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|||
|
{
|
|||
|
if (optionsBuilder.IsConfigured == false)
|
|||
|
{
|
|||
|
optionsBuilder.UseSqlServer(@"Data Source=.\SQLEXPRESS;Initial Catalog=SushiBarDatabase;Integrated Security=True;MultipleActiveResultSets=True;TrustServerCertificate=True");
|
|||
|
}
|
|||
|
base.OnConfiguring(optionsBuilder);
|
|||
|
}
|
|||
|
|
|||
|
public virtual DbSet<Buyer> Buyers { get; set; }
|
|||
|
public virtual DbSet<Cook> Cooks { get; set; }
|
|||
|
public virtual DbSet<Menu> Menus { get; set; }
|
|||
|
public virtual DbSet<Place> Places { get; set; }
|
|||
|
public virtual DbSet<Models.Task> Tasks { get; set; }
|
|||
|
public virtual DbSet<TaskMenu> TaskMenus { get; set; }
|
|||
|
}
|
|||
|
}
|