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

36 lines
1.5 KiB
C#
Raw Normal View History

using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UniversityDataBaseImplemet.Models;
2023-04-08 22:25:55 +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=University;Username=postgres;Password=postgres");
}
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 22:25:55 +04:00
public virtual DbSet<Discipline> Discipline { get; set; }
public virtual DbSet<EducationStatus> EducationStatuses { get; set; }
2023-04-08 22:25:55 +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; }
2023-04-08 22:25:55 +04:00
public virtual DbSet<StudentStream> StudentStreams { get; set; }
2023-04-07 19:09:06 +04:00
public virtual DbSet<Role> Roles { get; set; }
}
}