SUBD_Aleikin/Restaurant/RestaurantDatabaseImplement/RestaurantDatabase.cs

37 lines
1.3 KiB
C#
Raw Normal View History

using Microsoft.EntityFrameworkCore;
using RestaurantDatabaseImplement.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RestaurantDatabaseImplement
{
public class RestaurantDatabase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseNpgsql(@"
2023-05-17 00:48:03 +04:00
Host=192.168.0.108;
Port=5432;
Database=RestaurantDatabase;
Username=postgres;
Password=postgres");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Component> Components { set; get; }
public virtual DbSet<Product> Products { set; get; }
public virtual DbSet<ProductComponent> ProductComponents { set; get; }
public virtual DbSet<Provider> Providers { set; get; }
public virtual DbSet<ComponentProvider> ComponentProviders { set; get; }
public virtual DbSet<Order> Orders { set; get; }
public virtual DbSet<OrderProduct> OrderProducts { set; get; }
public virtual DbSet<Client> Clients { set; get; }
}
}