19 lines
835 B
C#
19 lines
835 B
C#
|
using DinerDataBaseImplement.Models;
|
|||
|
using Microsoft.EntityFrameworkCore;
|
|||
|
|
|||
|
namespace DinerDataBaseImplement
|
|||
|
{
|
|||
|
public class DinerDataBase : DbContext
|
|||
|
{
|
|||
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) {
|
|||
|
if (optionsBuilder.IsConfigured == false) {
|
|||
|
optionsBuilder.UseSqlServer(@"Data Source=DESKTOP-O0N00SH\SQLEXPRESS;Initial Catalog=DinerDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
|
|||
|
}
|
|||
|
base.OnConfiguring(optionsBuilder);
|
|||
|
}
|
|||
|
public virtual DbSet<Food> Components { get; set; }
|
|||
|
public virtual DbSet<Snack> Products { get; set; }
|
|||
|
public virtual DbSet<SnackFood> ProductComponents { get; set; }
|
|||
|
public virtual DbSet<Order> Orders { get; set; }
|
|||
|
}
|
|||
|
}
|