21 lines
658 B
C#
21 lines
658 B
C#
|
using Microsoft.EntityFrameworkCore;
|
|||
|
using OrdersDatabaseImplement.Models;
|
|||
|
|
|||
|
|
|||
|
namespace OrdersDatabaseImplement
|
|||
|
{
|
|||
|
public class OrdersDatabase : DbContext
|
|||
|
{
|
|||
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|||
|
{
|
|||
|
if (optionsBuilder.IsConfigured == false)
|
|||
|
{
|
|||
|
optionsBuilder.UseNpgsql(@"Host=localhost;Port=5432;Database=OrdersDatabase;Username=postgres;Password=postgres");
|
|||
|
}
|
|||
|
base.OnConfiguring(optionsBuilder);
|
|||
|
}
|
|||
|
public virtual DbSet<Order> Orders { set; get; }
|
|||
|
public virtual DbSet<Status> Statuses { set; get; }
|
|||
|
}
|
|||
|
}
|