17 lines
486 B
C#
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");
|
|
}
|
|
}
|
|
}
|