24 lines
1004 B
C#
24 lines
1004 B
C#
using DinerDatabaseImplement.Models;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using System.Collections.Generic;
|
|
|
|
namespace DinerDatabaseImplement
|
|
{
|
|
public class DinerDatabase : DbContext
|
|
{
|
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|
{
|
|
if (!optionsBuilder.IsConfigured)
|
|
{
|
|
optionsBuilder.UseSqlServer(@"Data Source=localhost\SQLEXPRESS01;Initial Catalog=DinerDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
|
|
}
|
|
base.OnConfiguring(optionsBuilder);
|
|
}
|
|
public virtual DbSet<Component> Components { get; set; }
|
|
public virtual DbSet<Snack> Snacks { get; set; }
|
|
public virtual DbSet<SnackComponent> SnackComponents { get; set; }
|
|
public virtual DbSet<Order> Orders { get; set; }
|
|
public virtual DbSet<Shop> Shops { get; set; }
|
|
public virtual DbSet<ShopSnacks> ShopSnacks { get; set; }
|
|
}
|
|
} |