2024-06-04 21:16:50 +04:00
|
|
|
|
using DatabaseImplement.Models;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace DatabaseImplement
|
|
|
|
|
{
|
|
|
|
|
public class Database : DbContext
|
|
|
|
|
{
|
|
|
|
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|
|
|
|
{
|
|
|
|
|
if (optionsBuilder.IsConfigured == false)
|
|
|
|
|
{
|
2024-06-25 18:32:16 +04:00
|
|
|
|
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
|
|
|
|
|
|
|
|
|
|
optionsBuilder.UseNpgsql("Server=192.168.191.42:32768;Database=gun_market;Username=postgres;Password=7355608;");
|
2024-06-04 21:16:50 +04:00
|
|
|
|
}
|
|
|
|
|
base.OnConfiguring(optionsBuilder);
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-26 02:46:29 +04:00
|
|
|
|
public virtual DbSet<Role> Roles { get; set; } = null!;
|
2024-06-04 21:16:50 +04:00
|
|
|
|
public virtual DbSet<User> Users { get; set; } = null!;
|
2024-06-20 22:32:22 +04:00
|
|
|
|
public virtual DbSet<Sell> Sells { get; set; } = null!;
|
|
|
|
|
public virtual DbSet<Purchase> Purchases { get; set; } = null!;
|
|
|
|
|
public virtual DbSet<Product> Products { get; set; } = null!;
|
2024-06-22 12:18:43 +04:00
|
|
|
|
public virtual DbSet<Supply> Supplies { get; set; } = null!;
|
|
|
|
|
public virtual DbSet<SupplyProduct> SupplyProducts { get; set; } = null!;
|
2024-06-22 15:10:46 +04:00
|
|
|
|
public virtual DbSet<Supplier> Suppliers { get; set; } = null!;
|
2024-06-23 17:04:11 +04:00
|
|
|
|
public virtual DbSet<SupplierProduct> SupplierProducts { get; set; } = null!;
|
|
|
|
|
public virtual DbSet<MediaFile> MediaFiles { get; set; } = null!;
|
2024-06-24 15:06:42 +04:00
|
|
|
|
public virtual DbSet<SellProducts> SellProducts { get; set; } = null!;
|
2024-06-23 20:39:28 +04:00
|
|
|
|
public virtual DbSet<SupplyDoc> SupplyDocs { get; set; } = null!;
|
2024-07-26 02:46:29 +04:00
|
|
|
|
public virtual DbSet<CartItem> CartItems { get; set; } = null!;
|
|
|
|
|
public virtual DbSet<Sale> Sales { get; set; } = null!;
|
|
|
|
|
|
2024-06-23 20:39:28 +04:00
|
|
|
|
}
|
2024-06-04 21:16:50 +04:00
|
|
|
|
}
|