26 lines
1.0 KiB
C#
26 lines
1.0 KiB
C#
using Microsoft.EntityFrameworkCore;
|
|
using SushiDatabaseImplement.Models;
|
|
using SushiShopDatabaseImplement.Models;
|
|
|
|
namespace SushiDatabaseImplement
|
|
{
|
|
public class SushiDatabase : DbContext
|
|
{
|
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|
{
|
|
if (optionsBuilder.IsConfigured == false)
|
|
{
|
|
optionsBuilder.UseSqlServer(@"Data Source=localhost\SQLEXPRESS;Initial Catalog=SushiDataBase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True"
|
|
);
|
|
}
|
|
base.OnConfiguring(optionsBuilder);
|
|
}
|
|
public virtual DbSet<Client> Clients { get; set; }
|
|
public virtual DbSet<Employee> Employees { get; set; }
|
|
public virtual DbSet<Component> Components { set; get; }
|
|
public virtual DbSet<Sushi> Sushies { set; get; }
|
|
public virtual DbSet<SushiComponent> SushiComponents { set; get; }
|
|
public virtual DbSet<Order> Orders { set; get; }
|
|
}
|
|
}
|