24 lines
985 B
C#
24 lines
985 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using System.ComponentModel;
|
|
using TaskTrackerDatabase.Models;
|
|
using Task = TaskTrackerDatabase.Models.Task;
|
|
namespace TaskTrackerDatabase
|
|
{
|
|
public class TaskTrackerDatabase : DbContext
|
|
{
|
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|
{
|
|
if (optionsBuilder.IsConfigured == false)
|
|
{
|
|
optionsBuilder.UseSqlServer(@"Data Source=DESKTOP-N8BRIPR\SQLEXPRESS;Initial Catalog=TaskTrackerDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
|
|
}
|
|
base.OnConfiguring(optionsBuilder);
|
|
}
|
|
public virtual DbSet<Project> Projects { set; get; }
|
|
public virtual DbSet<Organization> Organizations { set; get; }
|
|
public virtual DbSet<OrganizationProject> OrganizationProjects { set; get; }
|
|
public virtual DbSet<Task> Tasks { set; get; }
|
|
public virtual DbSet<User> Users { set; get; }
|
|
}
|
|
}
|