CourseWork_FurnitureFactory/FurnitureFactory/FurnitureFactoryDataBaseImplement/FurnitureDataBase.cs

46 lines
1.5 KiB
C#
Raw Normal View History

2023-04-07 18:23:45 +04:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.EntityFrameworkCore;
using FurnitureFactoryDataBaseImplement.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection.Metadata;
using System.Runtime.ConstrainedExecution;
using System.Text;
using System.Threading.Tasks;
using HeadsetModule = FurnitureFactoryDataBaseImplement.Models.HeadsetModule;
using System.Threading.Tasks;
namespace FurnitureFactoryDataBaseImplement
{
public class FurnitureDataBase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseNpgsql("Server=PostgreSQL;Host=localhost;Port=5432;Database=FurnitureFactoryDataBase;Username=postgres;Password=postgres");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Manager> Managers { set; get; }
public virtual DbSet<SalesSalons> SalesSalons { set; get; }
public virtual DbSet<Headset> Headsets { set; get; }
public virtual DbSet<HeadsetSalesSalons> HeadsetSalesSalons { set; get; }
public virtual DbSet<Orders> Orders { set; get; }
public virtual DbSet<OrdersSalesSalons> OrdersSalesSalons { set; get; }
//public virtual DbSet<Master> Masters { set; get; }
public virtual DbSet<Material> Materials { set; get; }
}
}