2023-04-07 13:24:39 +04:00
|
|
|
|
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;
|
2023-04-07 13:24:39 +04:00
|
|
|
|
|
|
|
|
|
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; }
|
2023-04-07 13:24:39 +04:00
|
|
|
|
public virtual DbSet<Document> Documents { get; set; }
|
2023-04-08 22:25:55 +04:00
|
|
|
|
public virtual DbSet<Discipline> Discipline { get; set; }
|
2023-04-07 13:24:39 +04:00
|
|
|
|
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; }
|
2023-04-07 13:24:39 +04:00
|
|
|
|
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; }
|
2023-04-07 13:24:39 +04:00
|
|
|
|
}
|
|
|
|
|
}
|