SUBD-Petrushin-Egor-PIbd-22/TaskTrackerDatabase/TaskTrackerDatabase.cs
2024-05-13 14:53:28 +04:00

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; }
}
}