PIbd-32.-Stroev-V.M.-COP/WinFormsLibrary1/DatabaseImplement/Database.cs

17 lines
486 B
C#
Raw Normal View History

2024-10-27 16:16:44 +04:00
using DatabaseImplement.Models;
using Microsoft.EntityFrameworkCore;
namespace DatabaseImplement
{
public class Database : DbContext
{
public DbSet<Product> Products { get; set; }
2024-11-11 22:20:20 +04:00
public DbSet<Category> Categories { get; set; }
2024-10-27 16:16:44 +04:00
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseNpgsql("Host=localhost;Port=5432;Database=kop;Username=postgres;Password=postgres");
}
}
}