2024-03-17 21:00:26 +04:00
|
|
|
|
using FishFactoryDatabaseImplement.Models;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
|
|
|
|
|
namespace FishFactoryDatabaseImplement
|
|
|
|
|
{
|
|
|
|
|
public class FishFactoryDatabase : DbContext
|
|
|
|
|
{
|
|
|
|
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|
|
|
|
{
|
|
|
|
|
if (optionsBuilder.IsConfigured == false)
|
|
|
|
|
{
|
2024-05-13 22:15:56 +04:00
|
|
|
|
optionsBuilder.UseNpgsql(@"Host=localhost;Database=FishFactory3;Username=postgres;Password=postgres");
|
2024-03-17 21:00:26 +04:00
|
|
|
|
}
|
|
|
|
|
base.OnConfiguring(optionsBuilder);
|
2024-03-19 20:55:45 +04:00
|
|
|
|
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
|
|
|
|
|
AppContext.SetSwitch("Npgsql.DisableDateTimeInfinityConversions", true);
|
2024-03-17 21:00:26 +04:00
|
|
|
|
}
|
|
|
|
|
public virtual DbSet<Component> Components { set; get; }
|
|
|
|
|
public virtual DbSet<Canned> Canneds { set; get; }
|
|
|
|
|
public virtual DbSet<CannedComponent> CannedComponents { set; get; }
|
2024-05-06 22:32:01 +04:00
|
|
|
|
public virtual DbSet<Client> Clients { set; get; }
|
|
|
|
|
public virtual DbSet<Order> Orders { set; get; }
|
2024-05-12 19:24:51 +04:00
|
|
|
|
public virtual DbSet<Implementer> Implementers { set; get; }
|
2024-03-17 21:00:26 +04:00
|
|
|
|
}
|
|
|
|
|
}
|