ISEbd-21_Zinovev_V.V._Furni.../FurnitureAssembly/FurnitureAssemblyDatabaseImplement/FurnitureAssemblyDatabase.cs
2024-05-16 19:54:23 +04:00

35 lines
1.4 KiB
C#

using FurnitureAssemblyDatabaseImplement.Models;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FurnitureAssemblyDatabaseImplement
{
public class FurnitureAssemblyDatabase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseNpgsql("Host=localhost;Database=FurnitureAssemblyDatabaseFull;Username=postgres;Password=postgres");
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
AppContext.SetSwitch("Npgsql.DisableDateTimeInfinityConversions", true);
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Models.Workpiece> Workpieces { set; get; }
public virtual DbSet<Models.Furniture> Furnitures { set; get; }
public virtual DbSet<Models.FurnitureWorkpiece> FurnitureWorkpieces { set; get; }
public virtual DbSet<Models.Order> Orders { set; get; }
public virtual DbSet<Models.Client> Clients { set; get; }
public virtual DbSet<Implementer> Implementers { set; get; }
public virtual DbSet<MessageInfo> Messages { set; get; }
}
}