PIbd-32.-Stroev-V.M.-COP/WinFormsLibrary1/DatabaseImplement/Database.cs
2024-11-11 22:20:20 +04:00

17 lines
486 B
C#

using DatabaseImplement.Models;
using Microsoft.EntityFrameworkCore;
namespace DatabaseImplement
{
public class Database : DbContext
{
public DbSet<Product> Products { get; set; }
public DbSet<Category> Categories { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseNpgsql("Host=localhost;Port=5432;Database=kop;Username=postgres;Password=postgres");
}
}
}