22 lines
886 B
C#
22 lines
886 B
C#
using ForumDatabaseImplement.Models;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using System.Collections.Generic;
|
|
|
|
namespace ForumDatabaseImplement
|
|
{
|
|
public class ForumDataBase : DbContext
|
|
{
|
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|
{
|
|
if (optionsBuilder.IsConfigured == false)
|
|
{
|
|
optionsBuilder.UseSqlServer(@"Data Source=DESKTOP-VG5USAH\SQLEXPRESS;Initial Catalog=ForumDataBaseFull;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
|
|
}
|
|
base.OnConfiguring(optionsBuilder);
|
|
}
|
|
public virtual DbSet<User> Users { set; get; }
|
|
public virtual DbSet<Answer> Answers { set; get; }
|
|
public virtual DbSet<Question> Questions { set; get; }
|
|
public virtual DbSet<Category> Categories { set; get; }
|
|
}
|
|
} |