PIbd-21_Pyatakov_KM_Markov_.../UniversityDataBaseImplemet/Database.cs

30 lines
1.4 KiB
C#
Raw Normal View History

using Microsoft.EntityFrameworkCore;
using UniversityDataBaseImplemet.Models;
2023-04-08 20:16:42 +04:00
using Stream = UniversityDataBaseImplemet.Models.Stream;
namespace UniversityDataBaseImplemet
{
public class Database : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseNpgsql("Host=localhost;Port=5432;Database=UniversityCourseWork;Username=postgres;Password=123");
}
base.OnConfiguring(optionsBuilder);
}
2023-04-07 19:22:59 +04:00
public virtual DbSet<User> User { get; set; }
public virtual DbSet<Document> Documents { get; set; }
2023-04-08 20:16:42 +04:00
public virtual DbSet<Discipline> Discipline { get; set; }
public virtual DbSet<EducationStatus> EducationStatuses { get; set; }
2023-04-08 20:16:42 +04:00
public virtual DbSet<EducationGroup> EducationGroups { get; set; }
public virtual DbSet<EducationGroupDocument> EducationGroupsDocuments { get; set; }
public virtual DbSet<EducationGroupStream> EducationGroupsStreams { get; set; }
public virtual DbSet<Stream> Streams { get; set; }
public virtual DbSet<Student> Students { get; set; }
public virtual DbSet<StudentDocument> StudentDocuments { get; set; }
public virtual DbSet<StudentStream> StudentStreams { get; set; }
}
}