using Microsoft.EntityFrameworkCore; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.ComponentModel; using BlogDatabase.Models; namespace BlogDatabaseImplement { public class BlogDatabase : DbContext { protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { if (optionsBuilder.IsConfigured == false) { optionsBuilder.UseNpgsql("Host=localhost;Port=5432;Database=ForumSubd;Username=postgres;Password=postgres"); } base.OnConfiguring(optionsBuilder); } public virtual DbSet Roles { set; get; } public virtual DbSet Users { set; get; } public virtual DbSet Topics { set; get; } public virtual DbSet Categories { set; get; } public virtual DbSet Messages { set; get; } } }